mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 16:17:34 +00:00
[jdk12] adding support for the new nodes introduced for the improvements to switch statements, and the ‘switch expression’ preview feature, as well as support for the concept of preview features in general.
This commit is contained in:
1 parent
031da25e35
commit
ccaefff69f
6 files changed
+154
-9
No files matched your search
@@ -0,0 +1,28 @@
|
||||
public class Switch12 {
|
||||
public void basic() {
|
||||
switch (5) {
|
||||
case 1:
|
||||
case 2:
|
||||
System.out.println("OK");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
public void multiCase() {
|
||||
switch (5) {
|
||||
case 1, 2:
|
||||
System.out.println("OK");
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public int switchExpr() {
|
||||
return switch (5) {
|
||||
case 1, 2 -> 0;
|
||||
case 3 -> {
|
||||
break 10;
|
||||
}
|
||||
default -> 10;
|
||||
} + 10;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user