Please provide
- Operating system: Ubuntu
- SonarLint plugin version: 7.3.0.59206
- Programming language you’re coding in: Java
- Is connected mode used: No
And a thorough description of the problem / question:
The following code produces a false positive:
public static void main(String[] args) {
if (args.length > 3) {
foo(true);
}
foo(false);
}
SonarLint reports issue java:S1126
“Replace this if-then-else statement by a single method invocation”.
This should not be issued because this is not an if-then-else statement and cannot be replaced by a single method invocation.