Hi, I found a false negative in SonarQube 26.7.0 with sonar-java 8.34 when two relational ranges overlap and make an expression always true.
Affected tool
SonarQube 26.7.0.124771; sonar-java 8.34 (build 44906)
Affected checker
SonarQube java:S2589
Minimal reproducer
class SpotbugsSonarqubeS2589OverlappingRanges {
boolean test(char value) {
return value > 'a' || value < 'f';
}
}
Reproduction command
sonar-scanner --version
sonar-scanner -Dsonar.projectKey=spotbugs-sonarqube-reproducer -Dsonar.sources=spotbugs-sonarqube-s2589-fn-overlapping-ranges.java -Dsonar.host.url="$SONAR_HOST_URL" -Dsonar.token="$SONAR_TOKEN"
Current behavior
SonarQube produces no java:S2589 diagnostic.
Expected behavior
SonarQube should report java:S2589 at line 3 because every char value satisfies at least one side of the expression.