public void testParameterizedCollectionFieldMatching_pr124808() { runTest("parameterized collection fields matched via pointcut");}
public void testGenericAspectsAndAnnotations_pr124654() { runTest("generic aspects and annotations");}
public void testCallInheritedGenericMethod_pr124999() { runTest("calling inherited generic method from around advice");}
- //public void testIncorrectlyReferencingPointcuts_pr122452() { runTest("incorrectly referencing pointcuts");}
- //public void testIncorrectlyReferencingPointcuts_pr122452_2() { runTest("incorrectly referencing pointcuts - 2");}
+ public void testIncorrectlyReferencingPointcuts_pr122452() { runTest("incorrectly referencing pointcuts");}
+ public void testIncorrectlyReferencingPointcuts_pr122452_2() { runTest("incorrectly referencing pointcuts - 2");}
public void testMixingNumbersOfTypeParameters_pr125080() {
runTest("mixing numbers of type parameters");
</ajc-test>
<ajc-test dir="bugs151" title="incorrectly referencing pointcuts">
- <compile files="pr122452.aj" options="-1.5"/>
+ <compile files="pr122452.aj" options="-1.5">
+ <message kind="warning" line="2" text="no match for this type name: Point [Xlint:invalidAbsoluteTypeName]"/>
+ <message kind="warning" line="3" text="no match for this type name: related.Hello [Xlint:invalidAbsoluteTypeName]"/>
+ <message kind="error" line="4" text="Syntax error on token "*", "(" expected"/>
+ </compile>
</ajc-test>
<ajc-test dir="bugs151" title="incorrectly referencing pointcuts - 2">
- <compile files="pr122452_2.aj" options="-1.5"/>
+ <compile files="pr122452_2.aj" options="-1.5">
+ <message kind="error" line="2" text="Syntax error on token "*", "(" expected"/>
+ </compile>
</ajc-test>
<ajc-test dir="bugs151/pr125080" title="mixing numbers of type parameters">
onType = null;
}
+ String simpleName = name.maybeGetSimpleName();
+ if (simpleName == null) {
+ throw new ParserException("(",tokenSource.peek(-1));
+ }
+
TypePatternList arguments = parseArgumentsPattern();
- return new ReferencePointcut(onType, name.maybeGetSimpleName(), arguments);
+ return new ReferencePointcut(onType, simpleName, arguments);
}
private Pointcut parseDesignatorPointcut(PointcutDesignatorHandler pcdHandler) {
if (shouldEnd && t!=IToken.EOF) {
throw new ParserException("<string>;",token);
}
-
+ // bug 125027: since we've eaten the ";" we need to set the index
+ // to be one less otherwise the end position isn't set correctly.
+ int currentIndex = tokenSource.getIndex();
+ tokenSource.setIndex(currentIndex-1);
+
return result.toString();
}
}
+ public void testStartAndEndPositionSet() throws IOException {
+ DeclareErrorOrWarning d =
+ parse("declare error: call(void foo()): \"that is bad\";");
+ assertEquals("start position should be 0", 0, d.getStart());
+ assertEquals("end position should be 46", 46, d.getEnd());
+ }
+
private DeclareErrorOrWarning parse(String string) {
return (DeclareErrorOrWarning)new PatternParser(string).parseDeclare();
}