aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2023-03-28 16:29:12 +0200
committerAlexander Kriegisch <Alexander@Kriegisch.name>2023-06-24 13:10:46 +0700
commitec5e94cc188bfb54ff96b8312548176c3c02c80a (patch)
treeaf12ceda7b843e4dcef2d6585a5f326252027134 /tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj
parentfbc79b2de7d6742883d41d7a8c91268bd1da3f55 (diff)
downloadaspectj-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/java19/RecordPatternsPreview1ExhaustivenessAspect.aj')
-rw-r--r--tests/features1919/java19/RecordPatternsPreview1ExhaustivenessAspect.aj12
1 files changed, 4 insertions, 8 deletions
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");
}
}