Fixes #20. Needs JDT Core grammar fix.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- Dependency versions -->
- <jdt.core.version>1.9.19</jdt.core.version>
+ <jdt.core.version>1.9.20-SNAPSHOT</jdt.core.version>
<asm.version>9.4</asm.version>
<lib.ant.version>1.6.3</lib.ant.version>
<lib.ant.xerces.version>2.6.2</lib.ant.xerces.version>
--- /dev/null
+/**
+ * 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";
+ }
+}
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);
}
</run>
</ajc-test>
+ <!--
+ 'Syntax error, insert "Expression" to complete Expression' when compiling parenthesised expressions
+ containing AspectJ keywords, e.g. '(before)', see https://github.com/eclipse/org.aspectj/issues/20
+ -->
+ <ajc-test dir="bugs1919/github_20" vm="1.5" title="parenthesised expression with AspectJ keyword">
+ <compile files="ParenthesisedAJKeywords.java" options="-1.8 -showWeaveInfo"/>
+ <run class="ParenthesisedAJKeywords">
+ <stdout>
+ <line text="before"/>
+ <line text="after"/>
+ <line text="around"/>
+ <line text="aspect"/>
+ <line text="pointcut"/>
+ <line text="declare"/>
+ <line text="privileged"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>