Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingPatternsInSwitch/BreakAndOtherStopWords.java
Mikhail Pyltsin d64809acc7 [java-highlighting] IDEA-324586 Highlight duplicated values with casts in java 21. Fix for null
GitOrigin-RevId: 85c0a0e8608267502c300b150fa9c5df23521efb
2023-07-08 13:45:02 +00:00

73 lines
1.5 KiB
Java

class Main {
private void correct(Object o) {
switch (o) {
case Integer i :
System.out.println();
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
default:
};
}
private void f(Object o) {
switch (o) {
case Integer i :
System.out.println();
break;
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
}
}
private void g(Object o) {
switch (o) {
case Integer i :
System.out.println();
case null:
throw new RuntimeException();
default: {}
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
}
}
private void h(Object o) {
switch (o) {
case Integer i :
System.out.println();
case null:
default: {
throw new RuntimeException();
}
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
}
}
private void k(Object o) {
for (;;) {
switch (o) {
case Integer i:
System.out.println();
case null:
default:
continue;
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
}
}
}
private void ret(Object o) {
switch (o) {
case Integer i: {
System.out.println();
return;
}
case null:
System.out.println(<error descr="Cannot resolve symbol 'i'">i</error>);
}
}
}