aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs150/AnnotationPlusPatternParseError.aj24
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml11
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/PatternParser.java4
4 files changed, 42 insertions, 1 deletions
diff --git a/tests/bugs150/AnnotationPlusPatternParseError.aj b/tests/bugs150/AnnotationPlusPatternParseError.aj
new file mode 100644
index 000000000..0c22916ee
--- /dev/null
+++ b/tests/bugs150/AnnotationPlusPatternParseError.aj
@@ -0,0 +1,24 @@
+import java.lang.annotation.*;
+
+public aspect AnnotationPlusPatternParseError {
+
+ pointcut bar() : call(* (@MemberOfMonitoredSet *)+.*(..));
+
+ declare warning : bar() : "humbug";
+
+}
+
+@interface MemberOfMonitoredSet {}
+
+@MemberOfMonitoredSet
+interface I {}
+
+class C implements I {
+
+ void bar() {
+ foo();
+ }
+
+ public void foo() {};
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 36b3a0b91..fdab101db 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -196,6 +196,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("IllegalStateException unpacking signature of nested parameterized type");
}
+ public void testParseErrorOnAnnotationStarPlusPattern() {
+ runTest("(@Foo *)+ type pattern parse error");
+ }
+
public void testMissingNamePattern_pr106461() { runTest("missing name pattern"); }
// helper methods.....
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 9dfbe2f91..d94182d55 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -186,6 +186,10 @@
<compile files="pr106634.aj" options="-1.5"/>
</ajc-test>
+ <ajc-test dir="bugs150" title="(@Foo *)+ type pattern parse error">
+ <compile files="AnnotationPlusPatternParseError.aj" options="-1.5"/>
+ </ajc-test>
+
<ajc-test dir="../docs/dist/doc/examples/introduction" title="introduction sample" vm="1.5">
<compile files="CloneablePoint.java,ComparablePoint.java,HashablePoint.java,Point.java" options="-1.5"/>
</ajc-test>
@@ -2371,6 +2375,13 @@
</run>
</ajc-test>
+ <ajc-test dir="java5/generics/genericaspects" title="generic aspect declare parents">
+ <compile files="DeclareParentsWithTypeVars.aj" options="-1.5">
+ </compile>
+ <run class="DeclareParentsWithTypeVars">
+ </run>
+ </ajc-test>
+
<!-- ajdk example -->
<ajc-test dir="java5/generics/genericaspects" title="generic aspects - 5 (ajdk)">
<compile files="Blob.java,BlobContainment.aj,ParentChildRelationship.aj" options="-1.5"/>
diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
index 76060b1b6..640762f91 100644
--- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
+++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java
@@ -587,7 +587,9 @@ public class PatternParser {
p = setAnnotationPatternForTypePattern(p,ap);
eat(")");
boolean isVarArgs = maybeEat("...");
- p.setIsVarArgs(isVarArgs);
+ if (isVarArgs) p.setIsVarArgs(isVarArgs);
+ boolean isIncludeSubtypes = maybeEat("+");
+ if (isIncludeSubtypes) p.includeSubtypes = true; // need the test because (A+) should not set subtypes to false!
return p;
}
int startPos = tokenSource.peek().getStart();