FP on squid:java:S3457

SonarQube version 7.9.2
SonarJava version 6.0.1

Code example:

    } catch (EntityNotFoundException | ProcessControlException | RuntimeException e) {
        LoggerFactory.getLogger(this.getClass()).warn("Private web proxy creation failed:", e);

is raising a “String contains no format specifiers.” issue.

It does not seem to pickup that e is a Throwable. Similar problem with debug(), error() methods.

The rule says:
logger.log(java.util.logging.Level.SEVERE, “Result.”, new Exception()); // compliant, parameter is an exception

Therefore the above should be compliant too.

Hi Stephen,

I’m not able to reproduce. Can you confirm that LoggerFactory is a org.slf4j.LoggerFactory?
Is it possible that SonarJava can’t find one of these class binaries on the classpath: EntityNotFoundException or ProcessControlException?
70% of the rule S3457 implementation just changed in SonarJava 6.2 (it should be released Monday 9th), could you check that there’s still this false-positive with SonarJava 6.2?