//int startPos = tokenSource.peek(-1).getStart();
//??? we lose source location for true start of !type
TypePattern p = new NotTypePattern(parseAtomicTypePattern());
+ p = setAnnotationPatternForTypePattern(p,ap);
return p;
}
if (maybeEat("(")) {
TypePattern p = parseTypePattern();
+ p = setAnnotationPatternForTypePattern(p,ap);
eat(")");
return p;
}
-// if (maybeEat("@")) {
-// AnnotationTypePattern ap = null;
-// if (maybeEat("(")) {
-// ap = parseAnnotationTypePattern();
-// eat(")");
-// } else {
-// ap = parseSimpleAnnotationName();
-// }
-// int startPos = tokenSource.peek().getStart();
-// TypePattern p = parseAtomicTypePattern();
-// int endPos = tokenSource.peek(-1).getEnd();
-// p.setLocation(sourceContext, startPos, endPos);
-// if (ap != null) {
-// if (p == TypePattern.ANY) {
-// p = new WildTypePattern(new NamePattern[] {NamePattern.ANY},false,0);
-// }
-// p.setAnnotationTypePattern(ap);
-// }
-// return p;
-// }
int startPos = tokenSource.peek().getStart();
TypePattern p = parseSingleTypePattern();
int endPos = tokenSource.peek(-1).getEnd();
+ p = setAnnotationPatternForTypePattern(p,ap);
p.setLocation(sourceContext, startPos, endPos);
return p;
}
+ private TypePattern setAnnotationPatternForTypePattern(TypePattern t, AnnotationTypePattern ap) {
+ TypePattern ret = t;
+ if (ap != AnnotationTypePattern.ANY) {
+ if (t == TypePattern.ANY) {
+ ret = new WildTypePattern(new NamePattern[] {NamePattern.ANY},false,0,false);
+ }
+ if (t.annotationPattern == AnnotationTypePattern.ANY) {
+ ret.setAnnotationTypePattern(ap);
+ } else {
+ ret.setAnnotationTypePattern(new AndAnnotationTypePattern(ap,t.annotationPattern)); //???
+ }
+ }
+ return ret;
+ }
+
public AnnotationTypePattern maybeParseAnnotationPattern() {
AnnotationTypePattern ret = AnnotationTypePattern.ANY;
AnnotationTypePattern nextPattern = null;
if (maybeEat("(")) {
TypePattern p = parseTypePattern();
ret = new NotAnnotationTypePattern(new WildAnnotationTypePattern(p));
+ eat(")");
return ret;
} else {
TypePattern p = parseSingleTypePattern();
if (maybeEat("(")) {
TypePattern p = parseTypePattern();
ret = new WildAnnotationTypePattern(p);
+ eat(")");
return ret;
} else {
TypePattern p = parseSingleTypePattern();
- private AnnotationTypePattern completeAnnotationPattern(AnnotationTypePattern p) {
- if (maybeEat("&&")) {
- return new AndAnnotationTypePattern(p,parseNotOrAnnotationPattern());
- }
- if (maybeEat("||")) {
- return new OrAnnotationTypePattern(p,parseAnnotationTypePattern());
- }
- return p;
- }
-
- protected AnnotationTypePattern parseAnnotationTypePattern() {
- AnnotationTypePattern ap = parseAtomicAnnotationPattern();
- if (maybeEat("&&")) {
- ap = new AndAnnotationTypePattern(ap, parseNotOrAnnotationPattern());
- }
-
- if (maybeEat("||")) {
- ap = new OrAnnotationTypePattern(ap, parseAnnotationTypePattern());
- }
- return ap;
- }
-
- private AnnotationTypePattern parseNotOrAnnotationPattern() {
- AnnotationTypePattern p = parseAtomicAnnotationPattern();
- if (maybeEat("&&")) {
- p = new AndAnnotationTypePattern(p,parseAnnotationTypePattern());
- }
- return p;
- }
+// private AnnotationTypePattern completeAnnotationPattern(AnnotationTypePattern p) {
+// if (maybeEat("&&")) {
+// return new AndAnnotationTypePattern(p,parseNotOrAnnotationPattern());
+// }
+// if (maybeEat("||")) {
+// return new OrAnnotationTypePattern(p,parseAnnotationTypePattern());
+// }
+// return p;
+// }
+//
+// protected AnnotationTypePattern parseAnnotationTypePattern() {
+// AnnotationTypePattern ap = parseAtomicAnnotationPattern();
+// if (maybeEat("&&")) {
+// ap = new AndAnnotationTypePattern(ap, parseNotOrAnnotationPattern());
+// }
+//
+// if (maybeEat("||")) {
+// ap = new OrAnnotationTypePattern(ap, parseAnnotationTypePattern());
+// }
+// return ap;
+// }
+//
+// private AnnotationTypePattern parseNotOrAnnotationPattern() {
+// AnnotationTypePattern p = parseAtomicAnnotationPattern();
+// if (maybeEat("&&")) {
+// p = new AndAnnotationTypePattern(p,parseAnnotationTypePattern());
+// }
+// return p;
+// }
protected AnnotationTypePattern parseAnnotationNameOrVarTypePattern() {
return p;
}
- private AnnotationTypePattern parseAtomicAnnotationPattern() {
- if (maybeEat("!")) {
- //int startPos = tokenSource.peek(-1).getStart();
- //??? we lose source location for true start of !type
- AnnotationTypePattern p = new NotAnnotationTypePattern(parseAtomicAnnotationPattern());
- return p;
- }
- if (maybeEat("(")) {
- AnnotationTypePattern p = parseAnnotationTypePattern();
- eat(")");
- return p;
- }
- int startPos = tokenSource.peek().getStart();
- eat("@");
- StringBuffer annotationName = new StringBuffer();
- annotationName.append(parseIdentifier());
- while (maybeEat(".")) {
- annotationName.append('.');
- annotationName.append(parseIdentifier());
- }
- TypeX type = TypeX.forName(annotationName.toString());
- AnnotationTypePattern p = new ExactAnnotationTypePattern(type);
- int endPos = tokenSource.peek(-1).getEnd();
- p.setLocation(sourceContext, startPos, endPos);
- return p;
- }
+// private AnnotationTypePattern parseAtomicAnnotationPattern() {
+// if (maybeEat("!")) {
+// //int startPos = tokenSource.peek(-1).getStart();
+// //??? we lose source location for true start of !type
+// AnnotationTypePattern p = new NotAnnotationTypePattern(parseAtomicAnnotationPattern());
+// return p;
+// }
+// if (maybeEat("(")) {
+// AnnotationTypePattern p = parseAnnotationTypePattern();
+// eat(")");
+// return p;
+// }
+// int startPos = tokenSource.peek().getStart();
+// eat("@");
+// StringBuffer annotationName = new StringBuffer();
+// annotationName.append(parseIdentifier());
+// while (maybeEat(".")) {
+// annotationName.append('.');
+// annotationName.append(parseIdentifier());
+// }
+// TypeX type = TypeX.forName(annotationName.toString());
+// AnnotationTypePattern p = new ExactAnnotationTypePattern(type);
+// int endPos = tokenSource.peek(-1).getEnd();
+// p.setLocation(sourceContext, startPos, endPos);
+// return p;
+// }
private boolean isAnnotationPattern(PatternNode p) {
public void testParseSimpleAnnotationPattern() {
PatternParser p = new PatternParser("@Foo");
- AnnotationTypePattern foo = p.parseAnnotationTypePattern();
+ AnnotationTypePattern foo = p.maybeParseAnnotationPattern();
+ foo = foo.resolveBindings(makeSimpleScope(),new Bindings(3),true);
assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)foo).annotationType);
}
public void testParseAndAnnotationPattern() {
- PatternParser p = new PatternParser("@Foo && @Goo");
- AnnotationTypePattern fooAndGoo = p.parseAnnotationTypePattern();
+ PatternParser p = new PatternParser("@Foo @Goo");
+ AnnotationTypePattern fooAndGoo = p.maybeParseAnnotationPattern();
assertTrue("AndAnnotationTypePattern",fooAndGoo instanceof AndAnnotationTypePattern);
- assertEquals("(@Foo && @Goo)",fooAndGoo.toString());
+ assertEquals("@(Foo) @(Goo)",fooAndGoo.toString());
+ fooAndGoo = fooAndGoo.resolveBindings(makeSimpleScope(),new Bindings(3),true);
+ assertEquals("@Foo @Goo",fooAndGoo.toString());
AnnotationTypePattern left = ((AndAnnotationTypePattern)fooAndGoo).getLeft();
AnnotationTypePattern right = ((AndAnnotationTypePattern)fooAndGoo).getRight();
assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)left).annotationType);
assertEquals("Goo",TypeX.forName("Goo"),((ExactAnnotationTypePattern)right).annotationType);
}
-
- public void testParseOrAnnotationPattern() {
- PatternParser p = new PatternParser("@Foo || @Goo");
- AnnotationTypePattern fooOrGoo = p.parseAnnotationTypePattern();
- assertTrue("OrAnnotationTypePattern",fooOrGoo instanceof OrAnnotationTypePattern);
- assertEquals("(@Foo || @Goo)",fooOrGoo.toString());
- AnnotationTypePattern left = ((OrAnnotationTypePattern)fooOrGoo).getLeft();
- AnnotationTypePattern right = ((OrAnnotationTypePattern)fooOrGoo).getRight();
- assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)left).annotationType);
- assertEquals("Goo",TypeX.forName("Goo"),((ExactAnnotationTypePattern)right).annotationType);
- }
-
+//
+// public void testParseOrAnnotationPattern() {
+// PatternParser p = new PatternParser("@Foo || @Goo");
+// AnnotationTypePattern fooOrGoo = p.parseAnnotationTypePattern();
+// assertTrue("OrAnnotationTypePattern",fooOrGoo instanceof OrAnnotationTypePattern);
+// assertEquals("(@Foo || @Goo)",fooOrGoo.toString());
+// AnnotationTypePattern left = ((OrAnnotationTypePattern)fooOrGoo).getLeft();
+// AnnotationTypePattern right = ((OrAnnotationTypePattern)fooOrGoo).getRight();
+// assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)left).annotationType);
+// assertEquals("Goo",TypeX.forName("Goo"),((ExactAnnotationTypePattern)right).annotationType);
+// }
+//
public void testParseNotAnnotationPattern() {
PatternParser p = new PatternParser("!@Foo");
- AnnotationTypePattern notFoo = p.parseAnnotationTypePattern();
+ AnnotationTypePattern notFoo = p.maybeParseAnnotationPattern();
assertTrue("NotAnnotationTypePattern",notFoo instanceof NotAnnotationTypePattern);
- assertEquals("(!@Foo)",notFoo.toString());
+ notFoo = notFoo.resolveBindings(makeSimpleScope(),new Bindings(3),true);
+ assertEquals("!@Foo",notFoo.toString());
AnnotationTypePattern body = ((NotAnnotationTypePattern)notFoo).getNegatedPattern();
assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)body).annotationType);
}
public void testParseBracketedAnnotationPattern() {
PatternParser p = new PatternParser("(@Foo)");
- AnnotationTypePattern foo = p.parseAnnotationTypePattern();
- assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
- assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)foo).annotationType);
+ AnnotationTypePattern foo = p.maybeParseAnnotationPattern();
+ // cannot start with ( so, we get ANY
+ assertEquals("ANY",AnnotationTypePattern.ANY,foo);
}
public void testParseFQAnnPattern() {
PatternParser p = new PatternParser("@org.aspectj.Foo");
- AnnotationTypePattern foo = p.parseAnnotationTypePattern();
- assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
- assertEquals("org.aspectj.Foo",TypeX.forName("org.aspectj.Foo"),((ExactAnnotationTypePattern)foo).annotationType);
+ AnnotationTypePattern foo = p.maybeParseAnnotationPattern();
+ assertEquals("@(org.aspectj.Foo)",foo.toString());
}
public void testParseComboPattern() {
- PatternParser p = new PatternParser("!((@Foo || @Goo) && !@Boo)");
- AnnotationTypePattern ap = p.parseAnnotationTypePattern();
- NotAnnotationTypePattern ntp = (NotAnnotationTypePattern) ap;
- AndAnnotationTypePattern atp = (AndAnnotationTypePattern) ntp.getNegatedPattern();
+// PatternParser p = new PatternParser("!((@Foo || @Goo) && !@Boo)");
+ PatternParser p = new PatternParser("@(Foo || Goo)!@Boo");
+ AnnotationTypePattern ap = p.maybeParseAnnotationPattern();
+ ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
+ AndAnnotationTypePattern atp = (AndAnnotationTypePattern) ap;
NotAnnotationTypePattern notBoo = (NotAnnotationTypePattern) atp.getRight();
ExactAnnotationTypePattern boo = (ExactAnnotationTypePattern) notBoo.getNegatedPattern();
- OrAnnotationTypePattern fooOrGoo = (OrAnnotationTypePattern) atp.getLeft();
- ExactAnnotationTypePattern foo = (ExactAnnotationTypePattern) fooOrGoo.getLeft();
- ExactAnnotationTypePattern goo = (ExactAnnotationTypePattern) fooOrGoo.getRight();
- assertEquals("(!((@Foo || @Goo) && (!@Boo)))",ap.toString());
- }
-
- public void testParseAndOrPattern() {
- PatternParser p = new PatternParser("@Foo && @Boo || @Goo");
- AnnotationTypePattern andOr = p.parseAnnotationTypePattern();
- assertTrue("Should be or pattern",andOr instanceof OrAnnotationTypePattern);
+ WildAnnotationTypePattern fooOrGoo = (WildAnnotationTypePattern) atp.getLeft();
+ assertEquals("@((Foo || Goo)) !@Boo",ap.toString());
}
+// public void testParseAndOrPattern() {
+// PatternParser p = new PatternParser("@Foo && @Boo || @Goo");
+// AnnotationTypePattern andOr = p.parseAnnotationTypePattern();
+// assertTrue("Should be or pattern",andOr instanceof OrAnnotationTypePattern);
+// }
+//
public void testParseBadPattern() {
PatternParser p = new PatternParser("@@Foo");
try {
- AnnotationTypePattern bad = p.parseAnnotationTypePattern();
+ AnnotationTypePattern bad = p.maybeParseAnnotationPattern();
fail("ParserException expected");
} catch(ParserException pEx) {
- assertEquals("identifier",pEx.getMessage());
+ assertEquals("expected name pattern",pEx.getMessage());
}
}
public void testParseBadPattern2() {
PatternParser p = new PatternParser("Foo");
- try {
- AnnotationTypePattern bad = p.parseAnnotationTypePattern();
- fail("ParserException expected");
- } catch(ParserException pEx) {
- assertEquals("@",pEx.getMessage());
- }
+ AnnotationTypePattern bad = p.maybeParseAnnotationPattern();
+ assertEquals("ANY",AnnotationTypePattern.ANY,bad);
}
+
public void testParseNameOrVarAnnotationPattern() {
PatternParser p = new PatternParser("@Foo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
}
public void testParseNameOrVarAnnotationPatternWithAnd() {
- PatternParser p = new PatternParser("@Foo && @Boo");
+ PatternParser p = new PatternParser("@Foo @Boo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
// rest of pattern not consumed...
- assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
- assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)foo).annotationType);
+ assertEquals("@Foo",foo.toString());
}
public void testMaybeParseAnnotationPattern() {
PatternParser p = new PatternParser("@Foo *");
TypePattern t = p.parseTypePattern();
assertTrue("WildTypePattern",t instanceof WildTypePattern);
- ExactAnnotationTypePattern etp = (ExactAnnotationTypePattern) t.annotationPattern;
- assertEquals("@Foo",etp.toString());
- assertEquals("@Foo *",t.toString());
+ AnnotationTypePattern atp = t.annotationPattern;
+ assertEquals("@(Foo)",atp.toString());
+ assertEquals("(@(Foo) *)",t.toString());
}
public void testParseTypePatternsWithAnnotationsComplex() {
- PatternParser p = new PatternParser("(@(@Foo || @Boo) (Foo || Boo))");
+ PatternParser p = new PatternParser("(@(Foo || Boo) (Foo || Boo))");
TypePattern t = p.parseTypePattern();
assertTrue("OrTypePattern",t instanceof OrTypePattern);
- OrAnnotationTypePattern etp = (OrAnnotationTypePattern) t.annotationPattern;
- assertEquals("(@Foo || @Boo)",etp.toString());
- assertEquals("(@(@Foo || @Boo) (Foo || Boo))",t.toString());
+ WildAnnotationTypePattern wtp = (WildAnnotationTypePattern) t.annotationPattern;
+ assertEquals("@((Foo || Boo))",wtp.toString());
+ assertEquals("(@((Foo || Boo)) (Foo || Boo))",t.toString());
}
- public void testRidiculousNotSyntax() {
- PatternParser p = new PatternParser("(@(!@Foo) (Foo || Boo))");
+ public void testNotSyntax() {
+ PatternParser p = new PatternParser("!@Foo (Foo || Boo))");
TypePattern t = p.parseTypePattern();
assertTrue("OrTypePattern",t instanceof OrTypePattern);
NotAnnotationTypePattern natp = (NotAnnotationTypePattern) t.annotationPattern;
- assertEquals("(!@Foo)",natp.toString());
- assertEquals("(@(!@Foo) (Foo || Boo))",t.toString());
+ assertEquals("!@(Foo)",natp.toString());
+ assertEquals("(!@(Foo) (Foo || Boo))",t.toString());
}
public void testParseMethodOrConstructorSigNoAP() {
public void testParseMethodOrConstructorSigSimpleAP() {
PatternParser p = new PatternParser("@Foo * *.*(..)");
SignaturePattern s = p.parseMethodOrConstructorSignaturePattern();
- assertEquals("Exact annotation","@Foo",((ExactAnnotationTypePattern)s.getAnnotationPattern()).toString());
+ assertEquals("@(Foo) annotation","@(Foo)",s.getAnnotationPattern().toString());
assertEquals("Any return","*",s.getReturnType().toString());
assertEquals("Any dec type","*",s.getDeclaringType().toString());
assertEquals("Any name","*",s.getName().toString());
- assertEquals("@Foo * *.*(..)",s.toString());
+ assertEquals("@(Foo) * *.*(..)",s.toString());
}
public void testParseMethodOrConstructorSigComplexAP() {
- PatternParser p = new PatternParser("@(!@Foo || @Goo) * *.*(..)");
+ PatternParser p = new PatternParser("!@(Foo || Goo) * *.*(..)");
SignaturePattern s = p.parseMethodOrConstructorSignaturePattern();
- assertEquals("complex annotation","((!@Foo) || @Goo)",s.getAnnotationPattern().toString());
+ assertEquals("complex annotation","!@((Foo || Goo))",s.getAnnotationPattern().toString());
assertEquals("Any return","*",s.getReturnType().toString());
assertEquals("Any dec type","*",s.getDeclaringType().toString());
assertEquals("Any name","*",s.getName().toString());
- assertEquals("@((!@Foo) || @Goo) * *.*(..)",s.toString());
+ assertEquals("!@((Foo || Goo)) * *.*(..)",s.toString());
}
public void testParseMethodFieldSigNoAP() {
public void testParseFieldSigSimpleAP() {
PatternParser p = new PatternParser("@Foo * *.*");
SignaturePattern s = p.parseFieldSignaturePattern();
- assertEquals("Exact annotation","@Foo",((ExactAnnotationTypePattern)s.getAnnotationPattern()).toString());
+ assertEquals("@Foo annotation","@(Foo)",s.getAnnotationPattern().toString());
assertEquals("Any field type","*",s.getReturnType().toString());
assertEquals("Any dec type","*",s.getDeclaringType().toString());
assertEquals("Any name","*",s.getName().toString());
- assertEquals("@Foo * *.*",s.toString());
+ assertEquals("@(Foo) * *.*",s.toString());
}
public void testParseFieldSigComplexAP() {
- PatternParser p = new PatternParser("@(!@Foo || @Goo) * *.*");
+ PatternParser p = new PatternParser("!@(Foo || Goo) * *.*");
SignaturePattern s = p.parseFieldSignaturePattern();
- assertEquals("complex annotation","((!@Foo) || @Goo)",s.getAnnotationPattern().toString());
+ assertEquals("complex annotation","!@((Foo || Goo))",s.getAnnotationPattern().toString());
assertEquals("Any field type","*",s.getReturnType().toString());
assertEquals("Any dec type","*",s.getDeclaringType().toString());
assertEquals("Any name","*",s.getName().toString());
- assertEquals("@((!@Foo) || @Goo) * *.*",s.toString());
+ assertEquals("!@((Foo || Goo)) * *.*",s.toString());
}
public void testExactAnnotationPatternMatching() {
PatternParser p = new PatternParser("@Foo");
- AnnotationTypePattern ap = p.parseAnnotationTypePattern();
+ AnnotationTypePattern ap = p.maybeParseAnnotationPattern();
ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
AnnotatedElementImpl ae = new AnnotatedElementImpl(new String[]{"Foo"});
assertTrue("matches element with Foo",ap.matches(ae).alwaysTrue());
}
public void testAndAnnotationPatternMatching() {
- PatternParser p = new PatternParser("@Foo && @Boo");
- AnnotationTypePattern ap = p.parseAnnotationTypePattern();
+ PatternParser p = new PatternParser("@Foo @Boo");
+ AnnotationTypePattern ap = p.maybeParseAnnotationPattern();
ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
AnnotatedElementImpl ae = new AnnotatedElementImpl(new String[] {"Foo","Boo"});
assertTrue("matches foo and boo",ap.matches(ae).alwaysTrue());
ae = new AnnotatedElementImpl(new String[] {"Goo"});
assertTrue("does not match goo",ap.matches(ae).alwaysFalse());
}
-
- public void testOrAnnotationPatternMatching() {
- PatternParser p = new PatternParser("@Foo || @Boo");
- AnnotationTypePattern ap = p.parseAnnotationTypePattern();
- ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
- AnnotatedElementImpl ae = new AnnotatedElementImpl(new String[] {"Foo","Boo"});
- assertTrue("matches foo and boo",ap.matches(ae).alwaysTrue());
- ae = new AnnotatedElementImpl(new String[] {"Foo"});
- assertTrue("matches foo",ap.matches(ae).alwaysTrue());
- ae = new AnnotatedElementImpl(new String[] {"Boo"});
- assertTrue("matches boo",ap.matches(ae).alwaysTrue());
- ae = new AnnotatedElementImpl(new String[] {"Goo"});
- assertTrue("does not match goo",ap.matches(ae).alwaysFalse());
- }
-
+//
+// public void testOrAnnotationPatternMatching() {
+// PatternParser p = new PatternParser("@Foo || @Boo");
+// AnnotationTypePattern ap = p.parseAnnotationTypePattern();
+// ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
+// AnnotatedElementImpl ae = new AnnotatedElementImpl(new String[] {"Foo","Boo"});
+// assertTrue("matches foo and boo",ap.matches(ae).alwaysTrue());
+// ae = new AnnotatedElementImpl(new String[] {"Foo"});
+// assertTrue("matches foo",ap.matches(ae).alwaysTrue());
+// ae = new AnnotatedElementImpl(new String[] {"Boo"});
+// assertTrue("matches boo",ap.matches(ae).alwaysTrue());
+// ae = new AnnotatedElementImpl(new String[] {"Goo"});
+// assertTrue("does not match goo",ap.matches(ae).alwaysFalse());
+// }
+//
public void testNotAnnotationPatternMatching() {
PatternParser p = new PatternParser("!@Foo");
- AnnotationTypePattern ap = p.parseAnnotationTypePattern();
+ AnnotationTypePattern ap = p.maybeParseAnnotationPattern();
ap = ap.resolveBindings(makeSimpleScope(),new Bindings(3),true);
AnnotatedElementImpl ae = new AnnotatedElementImpl(new String[] {"Foo","Boo"});
assertTrue("does not match foo and boo",ap.matches(ae).alwaysFalse());
public TestScope makeSimpleScope() {
BcelWorld bWorld = new BcelWorld(BcweaverTests.TESTDATA_PATH + "/testcode.jar"); // testcode contains Foo/Boo/Goo/etc
- return new TestScope(new String[] {"int", "java.lang.String","Foo"},
- new String[] {"a", "b","foo"},
+ return new TestScope(new String[] {"int", "java.lang.String","Foo","Boo","Goo"},
+ new String[] {"a", "b","foo","boo","goo"},
bWorld);
}