Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/Labels.java
Tagir Valeev c42a95c85e [java-highlighting] checkImplicitThisReferenceBeforeSuper, labels, exceptions -> ClassChecker
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 04edc2a2188da2e7f04e150aea5cba3916f3b5b2
2025-01-17 19:30:16 +00:00

69 lines
755 B
Java

// labels
import java.io.*;
class a {
void f() {
<error descr="Label without statement">a</error>:
}
void f1() {
a:
<error descr="Label without statement">b</error>:
}
void f2() {
a: return;
}
void f3() {
a: return;
}
void f4() {
a:
b:
return;
}
void f5() {
a:
if (4==5) return;
b: ;
}
void f6() {
a: ;
}
}
class AlreadyInUse {
void f0() {
a: {
f0();
<error descr="Label 'a' already in use">a</error>: f0();
}
}
void f1() {
a:
try {
f1();
<error descr="Label 'a' already in use">a</error>:
f1();
}
finally {
}
}
void f2() {
{
a:;
}
{
a:;
}
}
void f3() {
a:
new Object() {
void f() {
a:;
}
};
}
}