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