[java-highlighting] IDEA-284864 Improve reporting of always false while/for loops

GitOrigin-RevId: 9e7403383296cfa3c9478d8e635e592d31ba0518
This commit is contained in:
Tagir Valeev
2021-12-14 18:24:44 +07:00
committed by intellij-monorepo-bot
parent ed94f6f07b
commit 7367405b46
16 changed files with 102 additions and 34 deletions

View File

@@ -0,0 +1,15 @@
public class AlwaysFalseForLoop {
void test() {
int i = 0;
for(i++; <error descr="Loop condition is always false making the loop body unreachable">fa<caret>lse</error>; System.out.println("oops")) {
System.out.println("oops");
}
}
void test2() {
for(int j=0; <error descr="Loop condition is always false making the loop body unreachable">false</error>; j++) {
}
}
}