mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 21:53:58 +07:00
GitOrigin-RevId: 411e4842d0ecf8cf4db0308f854e179dee46ced3
21 lines
424 B
Java
21 lines
424 B
Java
// "Replace with enhanced 'switch' statement" "true-preview"
|
|
import java.util.*;
|
|
|
|
class SwitchExpressionMigration {
|
|
void test(int x) {
|
|
<caret>switch (x) {
|
|
case 1: {
|
|
System.out.println("1");
|
|
break;
|
|
}
|
|
case 2:
|
|
if (Math.random() > 0.5) {
|
|
System.out.println("2");
|
|
break;
|
|
} else {
|
|
System.out.println("3");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} |