Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlightingPatternsInSwitch/ReachabilityEnhancedPrimitives.java
T
2026-01-30 10:08:10 +00:00

36 lines
913 B
Java

class AAA{
void testBoolean(boolean a) {
switch (a) {
case true:
throw new IllegalArgumentException();
case false:
throw new IllegalArgumentException();
}
<error descr="Unreachable statement">System.out.println();</error>
}
void testBoolean2(Boolean a) {
switch (a) {
case true:
throw new IllegalArgumentException();
case null:
throw new IllegalArgumentException();
default:
throw new IllegalStateException("Unexpected value: " + a);
}
<error descr="Unreachable statement">System.out.println();</error>
}
void testFloat(float a) {
switch (a) {
case 1f:
throw new IllegalArgumentException();
case Number v:
throw new IllegalStateException("Unexpected value: " + a);
}
<error descr="Unreachable statement">System.out.println();</error>
}
static void main() {
}
}