From: Alexander Kriegisch Date: Wed, 4 Jan 2023 13:55:42 +0000 (+0100) Subject: Fix parenthesised AJ keyword compiler problem X-Git-Tag: V1_9_20~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f46d44017d020822cf145ce0ff23cc44ecfdfad;p=aspectj.git Fix parenthesised AJ keyword compiler problem Fixes #20. Needs JDT Core grammar fix. Signed-off-by: Alexander Kriegisch --- diff --git a/pom.xml b/pom.xml index ab3ff8e1b..7090992c1 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true - 1.9.19 + 1.9.20-SNAPSHOT 9.4 1.6.3 2.6.2 diff --git a/tests/bugs1919/github_20/ParenthesisedAJKeywords.java b/tests/bugs1919/github_20/ParenthesisedAJKeywords.java new file mode 100644 index 000000000..1ba013c57 --- /dev/null +++ b/tests/bugs1919/github_20/ParenthesisedAJKeywords.java @@ -0,0 +1,33 @@ +/** + * https://github.com/eclipse/org.aspectj/issues/20 + */ +public class ParenthesisedAJKeywords { + public static void main(String[] args) { + boolean before = true; + int after = 11; + String around = "around"; + boolean aspect = true; + int pointcut = 22; + String declare = "declare"; + String privileged = "privileged"; + + if ((before)) { + System.out.println(foo((before))); + switch ((after)) { + default: System.out.println("after"); + } + System.out.println((around)); + System.out.println(!(aspect) ? "no aspect" : "aspect"); + switch ((pointcut)) { + case 22: System.out.println("pointcut"); break; + default: System.out.println("xxx"); + } + System.out.println((declare)); + System.out.println((privileged)); + } + } + + public static String foo(boolean before) { + return (before) ? "before" : "after"; + } +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java index 1cfb22ff5..112a4548c 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java @@ -22,6 +22,11 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase { public void testsSwitchWith_Integer_MAX_VALUE() { runTest("switch with Integer.MAX_VALUE case"); } + + public void testsParenthesisedExpressionWithAjKeyword() { + runTest("parenthesised expression with AspectJ keyword"); + } + public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class); } diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml index 60d7e4f86..918313b97 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml @@ -185,4 +185,23 @@ + + + + + + + + + + + + + + + +