it seems that a new rule is available with latest version.
I have several issue reported as "Printf-style format strings should be used correctly (squid:S3457)"
I don't understand the description and what is wrong in my cases.
There are 2 different cases.
In the rules description we have:
java.util.Logger logger;
logger.log(java.util.logging.Level.SEVERE, "Result {0}.", myObject.toString()); // Noncompliant; no need to call toString() on objects
logger.log(java.util.logging.Level.SEVERE, "Result.", new Exception()); // compliant, parameter is an exception
logger.log(java.util.logging.Level.SEVERE, "Result '{0}'", 14); // Noncompliant {{String contains no format specifiers.}}
and
java.util.Logger logger;
logger.log(java.util.logging.Level.SEVERE, "Result {0}.", myObject);
logger.log(java.util.logging.Level.SEVERE, "Result {0}'", 14);
What's the difference with my cases?
Can you help me understand what is the correct way to write it?