Hi Team,
The expected SonarQube bug appears not to be caught in the code below, even though it’s caught in a very similar code as seen in the screenshot. Any thoughts?
import java.util.HashMap;
import java.util.Map;
class DeadStoreBug {
public static String showBug() {
boolean condition = false;
Map<String, String> letters = new HashMap<>();
letters.put("a", "Apple");
if(condition){
for (int i = 0; i < 10; i++) {
// Unreachable for loop inserted
}
}
letters.put("a", "Boy");
return letters.get("a");
}
public static boolean getCondition() {
return false;
}
}
Sonarqube version 25.5
Lang: Java
SonarScanner version: 5.0.1.3006
Screenshot of code scan results
