There are no issues detected with the following code. This is a false negative.
@Slf4j
public class TestClass {
public void func() {
log.warn("This log has no arguments, but it should: {}");
}
}
Luckily IntelliJ catches this issue and I was able to find 15 other occurrences in my project where someone had passed the wrong number of args for the number of placeholders they specified.
The use of Lombok annotations is relevant because it uses its own AST by modifying the existing AST. The Java Analyzer uses the Eclipse AST, so all the Lombok annotations are not processed and thus missing from the AST. For this reason, the Analyzer doesn’t have any information about fields autogenerated by Lombok annotations.
I created anyway the issue [SONARJAVA-5014] - Jira to investigate if it’s somehow possible to cover this false negative. In general, we can’t deal with Lombok annotations, so the strategy is to allow false negatives.