The Java compiler does not have built-in semantic knowledge about StringFormat parameters, so it cannot check them at compile time. For everything he knows, StringFormat is another class, and String.format is another method, and this format string is another string, like any other.
But yes, I feel your pain, having faced the same problems in the last couple of days. What they were supposed to do was to make the number of parameters “less cautious” and simply leave the end marks of% s unchanged.
jk.
source share