Files
openide/java/java-tests/testData/inspection/switchExpressionMigration/afterExhaustiveSwitchWithThrow5.java

13 lines
278 B
Java

// "Replace with 'switch' expression" "true-preview"
import org.jetbrains.annotations.Nullable;
class X {
int test5(Integer x) {
return switch (x) {
case 1 -> 2;
case 2 -> 4;
default -> throw new IllegalArgumentException();
};
}
}