False-positive on java:S2629

versions used: sonarcloud

minimal example:

import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

final Marker myMarker = MarkerFactory.getMarker("MY_MARKER");
final Logger LOG = LoggerFactory.getLogger(MyClass.class);
if (LOG.isDebugEnabled(myMarker)) {
      LOG.debug(
          myMarker,
          "message: {}.",
          /* non trivial operation providing argument */
     )
     ...
}

based on the following dependency

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.30</version>
    </dependency>

Hello @Martin_R,
Thanks for reporting the issue. It looks like we can reproduce the issue.
A ticket has been created to fix the problem.

Cheers,

Dorian

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.