mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
GitOrigin-RevId: 0ba6182fe01fc0909883fc098497c91b1a585a57
21 lines
502 B
Java
21 lines
502 B
Java
import java.util.OptionalInt;
|
|
import java.util.Random;
|
|
|
|
class OptionalIntSwitch {
|
|
// IDEA-240631
|
|
public static void main(String[] args) {
|
|
OptionalInt opt = OptionalInt.of(new Random().nextInt() % 2);
|
|
|
|
switch (opt.getAsInt()) {
|
|
case 0:
|
|
System.out.println("zero");
|
|
break;
|
|
case 1:
|
|
System.out.println("one");
|
|
break;
|
|
case <warning descr="Switch label '2' is unreachable">2</warning>:
|
|
System.out.println("two");
|
|
break;
|
|
}
|
|
}
|
|
} |