Hi Sonarqube Team,
The expected SonarQube bug (RSPEC-5850) appears not to be detected in the code below, even though it’s caught in a very similar code as seen in the screenshot. Any thoughts?
import java.util.regex.Pattern;
import java.util.regex.Matcher;
class Main {
public static void main(String[] args) {
Main main = new Main();
main.showBug();
}
public void showBug() {
String regex = "^a|b|c$";
regex = regex;
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher("b");
System.out.println(matcher.find());
}
}
Sonarqube version 25.5
Lang: Java
SonarScanner version: 5.0.1.3006
Screenshot of code scan results
