Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/Loop.java
Tagir Valeev a891bc5b66 [java-highlighting] break, continue errors -> StatementChecker; wording adjusted
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: c16e11baec8b9191ac809a34fc919a4375dd0ebd
2025-01-28 17:28:10 +00:00

66 lines
1.3 KiB
Java

class a {
static class ff { }
void f() {
<error descr="'continue' statement outside of loop">continue;</error>
while (true) {
continue;
}
do { continue; } while (true);
switch (1) {
case 1: <error descr="'continue' statement outside of loop">continue;</error>
}
for (;;) {
continue;
}
for (;;) {
new ff() {
void f() {
<error descr="'continue' statement outside of loop">continue;</error>
}
};
continue;
}
while (true) {
class s {
{
<error descr="'continue' statement outside of loop">continue;</error>
}
}
continue;
}
do {
class s {
{
<error descr="'continue' statement outside of loop">continue;</error>
}
}
continue;
} while (true);
a:
if (2==4) {
for (;;) {
<error descr="'continue' target must be a loop label: 'a'">continue a;</error>
}
}
a:
b:
for (;;) {
<error descr="'continue' target must be a loop label: 'a'">continue a;</error>
}
int i = 0;
for (<error descr="Not a statement">i==0?7:8;</error> ; ) ;
for (<error descr="Invalid statement">if (i<0) i++;</error> ; ) ;
for (new ff(), new ff(); ; ) ;
for (<error descr="Invalid statement">class C { }</error>; true; ) ;
}
}