[jdk26] Out of an abundance of caution: Added a test to confirm that lombok does not interact with primitive types in switch pattern matching. Indeed it doesn't.

This commit is contained in:
Reinier Zwitserloot committed 2026-04-08 01:35:50 +02:00
1 parent bc86bfde63
commit a67306f2e5
2 files changed
+21

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
public class Switch26 {
String switchPatternMatching(int i) {
return switch (i) {
case 1 -> "one";
case 5 -> "five";
case int y when y >= 0 -> "+" + y;
case int y -> "-" + -y;
};
}
}
+11
View File
@@ -0,0 +1,11 @@
// version 26:
public class Switch26 {
String switchPatternMatching(int i) {
return switch (i) {
case 1 -> "one";
case 5 -> "five";
case int y when y >= 0 -> "+" + y;
case int y -> "-" + -y;
};
}
}