java:S2629 - "Preconditions" and logging arguments should not require evaluation
- False Positive
- SonarLint plugin for IntelliJ version 10.8.1.79205
- Java, JDK 22
I call an isInfoEnabled
precondition, and yet operations like map.get display this issue.
if (!logger.isInfoEnabled()) {
return;
}
HashMap<String, String> map = new HashMap<>();
map.put("test", "test");
logger.info("log {}", map.get("test"));
logger
is public class MyLogger implements org.slf4j.Logger, CustomInterface- Library is
slf4j-api-2.0.9.jar