A false negative about the rule IL_INFINITE_LOOP
Jane-PL-256 opened this issue · comments
Jane commented
This rule is used to detect infinite loop. SpotBugs can recognize the issue in the following code example:
public void test4(boolean b) {
while (b = true) { // can report a warning
System.out.println("Wow");
}
}
But the following example cannot be detected, these two cases are equivalent.
public void test4(boolean b) {
do {
System.out.println("Wow");
} while (b = true); // should report a warning here
}
Version: LATEST
Iuliia Sokhranna commented
Judit Knoll commented
According to #2518, this issue is solved.