[java-false-positive] squid:S3457 String contains no format specifiers slf4j with exception

409 views
Skip to first unread message

Alon Bar-Lev

unread,
Apr 3, 2018, 5:15:13 AM4/3/18
to sona...@googlegroups.com
Hi,

The following is valid:

catch(Exception e) {
    logger.debug("XXX", e);
}

However, produces squid:S3457 String contains no format specifiers, while not all slf4j are format enabled, throwable at 2nd parameter is not part of format, in recent versions of slf4j, last parameter can be throwable and will not be part of the format.

This popped out only at recent update, please revert or exclude slf4j for now.

Thanks,
Alon

Nicolas Peru

unread,
Apr 3, 2018, 5:44:20 AM4/3/18
to Alon Bar-Lev, sona...@googlegroups.com
Hi, 

What version of SonarJava analyzer are you using ? 

Thanks,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/CAOazyz2kryvF5b5gk3S5-zwGMbtQywc9RWwqLZmcnM8nOxY36Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas Peru | SonarSource

Charles Morin

unread,
Apr 5, 2018, 11:13:42 AM4/5/18
to SonarQube
Having the same issue as we speak. SonarQube 6.7.2 LTS and the latest SonarJava plugin (sonar-java-plugin-5.2.0.13398.jar).

if (!Files.deleteIfExists(Paths.get(file.getPath()))) {
    logger
.error("Could not delete temp file.");
}

afb...@gmail.com

unread,
Apr 17, 2018, 12:18:38 PM4/17/18
to SonarQube
I get this error with:

LOGGER.error("Could not get the checksum");

Nicolas Peru

unread,
Apr 27, 2018, 10:18:20 AM4/27/18
to afb...@gmail.com, SonarQube
Hi, 

Which version of SonarJava are you using ?

Cheers, 

Le mar. 17 avr. 2018 à 18:18, <afb...@gmail.com> a écrit :
I get this error with:

LOGGER.error("Could not get the checksum");

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages