switch (pair) {
case Pair<I>(I i, C c) -> System.out.println("x");
case Pair<I>(I i, D d) -> System.out.println("y");
- // TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed.
// Fixed since Java 21, see features1921/java21/RecordPatternsPreview1ExhaustivenessAspect.aj.
default -> System.out.println("z");
}
case Pair<I>(C c, I i) -> System.out.println("a");
case Pair<I>(D d, C c) -> System.out.println("b");
case Pair<I>(D d1, D d2) -> System.out.println("c");
- // TODO: remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed.
// Fixed since Java 21, see features1921/java21/RecordPatternsPreview1ExhaustivenessAspect.aj.
default -> System.out.println("d");
}
switch (p2) {
case Pair<I>(I i, C c) -> System.out.println("x");
case Pair<I>(I i, D d) -> System.out.println("y");
- // TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed.
// Fixed since Java 21, see features1921/java21/RecordPatternsPreview1ExhaustivenessOK1.java.
default -> System.out.println("z");
}
case Pair<I>(C c, I i) -> System.out.println("a");
case Pair<I>(D d, C c) -> System.out.println("b");
case Pair<I>(D d1, D d2) -> System.out.println("c");
- // TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed.
// Fixed since Java 21, see features1921/java21/RecordPatternsPreview1ExhaustivenessOK1.java.
default -> System.out.println("d");
}
public static void main(String[] args) {
// Embedded expressions can be strings
String firstName = "Bill", lastName = "Duck";
- // TODO: Due to https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1719, this is currently rendered incorrectly
System.out.println(STR."\{firstName} \{lastName}");
// Embedded expressions can perform arithmetic
runTest("named aspect with simple main method");
}
- /**
- * Still not implemented with the Java 21 release Eclipse 2023-12 (4.30),
- * see <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106">GitHub issue 1106</a>.
- */
public void testUnnamedClassWithSimpleMainMethod() {
runTest("unnamed class with simple main method");
}
<!-- Java 21 final, Java 17, 18, 19, 20 preview -->
<ajc-test dir="features1920/java20" vm="21" title="switch pattern matching preview 4 error">
<compile files="SwitchPatternPreview4Error.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
<message kind="error" file="SwitchPatternPreview4Error.java" text="This case label is dominated by one of the preceding case labels"/>
</compile>
</ajc-test>
<!-- Java 21 final, Java 17, 18, 19, 20 preview -->
<ajc-test dir="features198/java17" vm="21" title="switch pattern matching error">
<compile files="SwitchPatternError.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
<message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case labels"/>
</compile>
</ajc-test>
<!-- Java 21 final, Java 17, 18, 19, 20 preview -->
<ajc-test dir="features1919/java19" vm="21" title="switch pattern matching preview 3 error 2">
<compile files="SwitchPatternPreview3Error2.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
<message kind="error" file="SwitchPatternPreview3Error2.java" text="This case label is dominated by one of the preceding case labels"/>
</compile>
</ajc-test>
</ajc-test>
<!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
<ajc-test dir="features1921/java21" vm="21" title="unnamed patterns">
<compile files="UnnamedPatternsPreview1.java" options="--enable-preview -21"/>
<run class="UnnamedPatternsPreview1" vmargs="--enable-preview">
</ajc-test>
<!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
<ajc-test dir="features1921/java21" vm="21" title="unnamed patterns aspect">
<compile files="UnnamedPatternsPreview1Aspect.aj" options="--enable-preview -21"/>
<run class="UnnamedPatternsPreview1Aspect" vmargs="--enable-preview">
</ajc-test>
<!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106 is done -->
<ajc-test dir="features1921/java21" vm="21" title="unnamed class with simple main method">
<compile files="UnnamedClassWithSimpleMainMethodPreview1.java" options="--enable-preview -21"/>
<run class="UnnamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">
<suite>
<!-- Java 22 final, 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
<ajc-test dir="features1921/java21" vm="22" title="unnamed patterns">
<compile files="UnnamedPatternsPreview1.java" options="-22"/>
<run class="UnnamedPatternsPreview1">
</ajc-test>
<!-- Java 22 final, 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
<ajc-test dir="features1921/java21" vm="22" title="unnamed patterns aspect">
<compile files="UnnamedPatternsPreview1Aspect.aj" options="-22"/>
<run class="UnnamedPatternsPreview1Aspect">
</ajc-test>
<!-- Java 21, 22 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106 is done -->
<ajc-test dir="features1921/java21" vm="22" title="unnamed class with simple main method">
<compile files="UnnamedClassWithSimpleMainMethodPreview1.java" options="-22 --enable-preview"/>
<run class="UnnamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">