diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-03-28 16:29:12 +0200 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2023-06-24 13:10:46 +0700 |
commit | ec5e94cc188bfb54ff96b8312548176c3c02c80a (patch) | |
tree | af12ceda7b843e4dcef2d6585a5f326252027134 /tests/features1919 | |
parent | fbc79b2de7d6742883d41d7a8c91268bd1da3f55 (diff) | |
download | aspectj-ec5e94cc188bfb54ff96b8312548176c3c02c80a.tar.gz aspectj-ec5e94cc188bfb54ff96b8312548176c3c02c80a.zip |
Add basic tests for Java 20, deactivate Java 19 preview tests
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/features1919')
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/features1919/java19/RecordPatternsPreview1Error.java b/tests/features1919/java19/RecordPatternsPreview1Error.java index 2a5038e89..c4a89b8d6 100644 --- a/tests/features1919/java19/RecordPatternsPreview1Error.java +++ b/tests/features1919/java19/RecordPatternsPreview1Error.java @@ -1,5 +1,5 @@ /** - * This was not working as expected in ECJ after the initial Java 19 merge the JDT Core main line, + * This was not working as expected in ECJ after the initial Java 19 merge from the JDT Core main line, * see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450. */ public class RecordPatternsPreview1Error { diff --git a/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj index 44c7f12d0..4fad25327 100644 --- a/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj +++ b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj @@ -5,17 +5,15 @@ public aspect RecordPatternsPreview1ExhaustivenessAspect { doSomething(p2); } - public static void doSomething(Pair pair) { + public static void doSomething(Pair<I> pair) { System.out.println(pair.toString().replaceAll("@[0-9a-f]+", "@000")); } - before(Pair pair) : execution(* doSomething(Pair)) && args(pair) { + before(Pair<I> pair) : execution(* doSomething(Pair)) && args(pair) { 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. But even with the default clause, it generates wrong byte code and throws runtime error: - // NoSuchMethodError: 'I Pair.x()' + // TODO: Remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed default -> System.out.println("z"); } @@ -23,9 +21,7 @@ public aspect RecordPatternsPreview1ExhaustivenessAspect { 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. But even with the default clause, it generates wrong byte code and throws runtime error: - // NoSuchMethodError: 'I Pair.x()' + // TODO: remove redundant default clause when https://github.com/eclipse-jdt/eclipse.jdt.core/issues/455 has been fixed default -> System.out.println("d"); } } diff --git a/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK1.java b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK1.java index 4153d5021..e815c512d 100644 --- a/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK1.java +++ b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK1.java @@ -10,12 +10,16 @@ public class RecordPatternsPreview1ExhaustivenessOK1 { 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 + default -> System.out.println("z"); } switch (p2) { 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 + default -> System.out.println("d"); } } } |