[jdk21] Remove test for parenthesized pattern (removed in JEP 441)

This commit is contained in:
Rawi01 committed 2023-06-24 16:57:26 +02:00
1 parent 73d2686bc2
commit cb76e67205
3 files changed
+52 -1

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
public class Switch21 {
String switchPatternMatching(Object o) {
return switch (o) {
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
case Double d -> String.format("double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
};
}
String switchNull(Object o) {
return switch (o) {
case null, default -> "?";
};
}
String switchGuardPattern(Object o) {
return switch (o) {
case String s when s.length() > 1 -> s;
case String s -> s;
default -> o.toString();
};
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// version 19:
// version 19:20
public class Switch19 {
String switchPatternMatching(Object o) {
return switch (o) {
+26
View File
@@ -0,0 +1,26 @@
// version 21:
public class Switch21 {
String switchPatternMatching(Object o) {
return switch (o) {
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
case Double d -> String.format("double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
};
}
String switchNull(Object o) {
return switch (o) {
case null, default -> "?";
};
}
String switchGuardPattern(Object o) {
return switch (o) {
case String s when s.length() > 1 -> s;
case String s -> s;
default -> o.toString();
};
}
}