diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-10-02 13:55:59 +0200 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-10-02 13:57:53 +0200 |
commit | 93e3bd515e5244a2d365862f07aaf7a449b6d510 (patch) | |
tree | 1523e3ea04fa5a3767ec7c42c69bb83797591e75 | |
parent | 30773df20ff88e4fb5ba76a1e0aadc4b02ba0d58 (diff) | |
download | aspectj-93e3bd515e5244a2d365862f07aaf7a449b6d510.tar.gz aspectj-93e3bd515e5244a2d365862f07aaf7a449b6d510.zip |
Update ECJ version, activate Java 17 preview features tests
After JDT Core (ECJ) was updated to the final Java 17 feature set, the
tests now pass as expected.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
4 files changed, 19 insertions, 23 deletions
diff --git a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties index 36e9597a5..a54d7ec22 100644 --- a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties +++ b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties @@ -1,5 +1,5 @@ compiler.name = AspectJ Compiler -compiler.version = Eclipse Compiler a00b62fa3572b0 (17Mar2021) - Java16 +compiler.version = Eclipse Compiler f8768b6899a6a2 (15Sep2021) - Java17 compiler.copyright = misc.version = {0} {1} - {2} {3} diff --git a/tests/features198/java17/SwitchPatternAspect.aj b/tests/features198/java17/SwitchPatternAspect.aj index 5ca2b9611..5a3eeeb30 100644 --- a/tests/features198/java17/SwitchPatternAspect.aj +++ b/tests/features198/java17/SwitchPatternAspect.aj @@ -1,3 +1,5 @@ +import java.util.List; + aspect SwitchPatternAspect { Object around(Object o) : execution(* doSomethingWithObject(*)) && args(o) { System.out.println(switch (o) { @@ -41,7 +43,7 @@ final class A implements S {} final class B implements S {} record C(int i) implements S {} // Implicitly final -public class Application { +class Application { public static void main(String[] args) { doSomethingWithObject(null); doSomethingWithObject(123); @@ -54,12 +56,12 @@ public class Application { doSomethingWithShape(new Circle(5)); doSomethingWithShape(new Circle(6)); - doSomethingWithSealedClass(new A())); - doSomethingWithSealedClass(new B())); - doSomethingWithSealedClass(new C(5))); + doSomethingWithSealedClass(new A()); + doSomethingWithSealedClass(new B()); + doSomethingWithSealedClass(new C(5)); } - public Object doSomethingWithObject(Object o) { return o; } - public void doSomethingWithSealedClass(S s) {} - public void doSomethingWithShape(Shape s) {} + public static Object doSomethingWithObject(Object o) { return o; } + public static void doSomethingWithSealedClass(S s) {} + public static void doSomethingWithShape(Shape s) {} } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java index e17ae26d6..c1b0f8c44 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Java17PreviewFeaturesTests.java @@ -18,26 +18,20 @@ import org.aspectj.testing.XMLBasedAjcTestCaseForJava17Only; public class Java17PreviewFeaturesTests extends XMLBasedAjcTestCaseForJava17Only { public void testSwitchPatternMatchingCaseLabelDominatedByPrecedingError() { - // TODO: JDT Core does not support detecting type domination detection in the development version yet -> activate when available - System.out.println("TODO: JDT Core does not support detecting type domination detection in the development version yet -> activate when available"); -// runTest("switch pattern matching error"); + runTest("switch pattern matching error"); } public void testSwitchPatternMatchingJava() { - // TODO: JDT Core does not support sealed class coverage in the development version yet -> activate when available - System.out.println("TODO: JDT Core does not support sealed class coverage in the development version yet -> activate when available"); -// runTest("switch pattern matching java"); -// checkVersion("SwitchPatternOK", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); + runTest("switch pattern matching java"); + checkVersion("SwitchPatternOK", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); } public void testSwitchPatternMatchingAspect() { - // TODO: JDT Core does not support sealed class coverage in the development version yet -> activate when available - System.out.println("TODO: JDT Core does not support sealed class coverage in the development version yet -> activate when available"); -// runTest("switch pattern matching aspect"); -// checkVersion("SwitchPatternAspect", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); -// checkVersion("Application", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); -// checkVersion("Shape", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); -// checkVersion("S", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); + runTest("switch pattern matching aspect"); + checkVersion("SwitchPatternAspect", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Application", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); + checkVersion("Shape", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); + checkVersion("S", Constants.MAJOR_17, Constants.PREVIEW_MINOR_VERSION); } public static Test suite() { diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml index a0c26d098..9937413a9 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml @@ -30,7 +30,7 @@ <ajc-test dir="features198/java17" vm="17" title="switch pattern matching error"> <compile files="SwitchPatternError.java" options="--enable-preview -17"> <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it --> - <message kind="error" file="SwitchPatternError.java" text="XXX"/> + <message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case label"/> </compile> </ajc-test> |