Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3274

S3457 should not raise issue on slf4j methods with a throwable argument

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      SLF4j Logger API contains method with the following signature :

      warn​(String msg, Throwable t)

      Those kind of calls lead to raising false positive as no formatting is expected in those cases :

       slf4jLog.error("message ", new Exception()); // false positive 

      The fix should concern all levels of log : debug, error, info, trace, warn as all those levels have a method taking a simple throwable argument.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.gumowski Michael Gumowski
              Reporter:
              nicolas.peru Nicolas Peru
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: