I have below code :
String s1 = "a";
String s2 = "a";
if (s1 == s2) {
System.out.println("string not equal");
}
When I analyze this code using SonarLint it doesnt get caught by it. I expect this should get caught by below Rule
squid:S1698-"==" and "!=" should not be used when "equals" is overridden
I have checked this both in standalone as well as in connected mode with Sonar Qube 7.0. Does anybody has any idea about this why sonar is behaving like this?
---------------Edit------------------
Same is also happening for :
Integer x= 500;
Integer y= 500;
if (x==y){
System.out.println("not equal");
}