// public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
// public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
// public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
+ public void testAnnotMethod_pr156962() { runTest("Test Annot Method");}
+ public void testAnnotMethodHasMember_pr156962() { runTest("Test Annot Method Has Member"); }
public void testMixingGenerics_pr152848() { runTest("mixing generics"); }
public void testIncorrectStaticinitializationWeaving_pr149560_1() { runTest("incorrect staticinitialization weaving - codestyle");}
public void testIncorrectStaticinitializationWeaving_pr149560_2() { runTest("incorrect staticinitialization weaving - annstyle");}
<!-- AspectJ v1.5.3 Tests -->
<suite>
+ <ajc-test dir="bugs153/pr156962" title="Test Annot Method">
+ <compile files="Sample.java, WarnDeprecatedMethod.aj" options="-1.5">
+ <message kind="warning" line="2" text="deprecated method"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs153/pr156962" title="Test Annot Method Has Member">
+ <compile files="Sample.java, LiftDeprecation.aj" options="-1.5 -XhasMember -showWeaveInfo -Xlint:ignore">
+ <message kind="weave" text="'Sample' (Sample.java:1) is annotated with @Deprecated type annotation from 'LiftDeprecation' (LiftDeprecation.aj:2)"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs153/pr152848" title="mixing generics">
<compile files="PairGeneric.java" options="-1.5" outjar="pair.jar"/>
<compile files="BaseType.java" options="-1.5" outjar="basetype.jar" classpath="pair.jar"/>
annotations = new AnnotationX[annos.length];
for (int i = 0; i < annos.length; i++) {
Annotation annotation = annos[i];
- ResolvedType rtx = world.resolve(UnresolvedType.forName(annotation.getTypeName()));
- annotationTypes.add(rtx);
+ annotationTypes.add(world.resolve(UnresolvedType.forSignature(annotation.getTypeSignature())));
annotations[i] = new AnnotationX(annotation,world);
}
}
annotations = new AnnotationX[annos.length];
for (int i = 0; i < annos.length; i++) {
Annotation annotation = annos[i];
- ResolvedType rtx = world.resolve(UnresolvedType.forName(annotation.getTypeName()));
- annotationTypes.add(rtx);
+ annotationTypes.add(world.resolve(UnresolvedType.forSignature(annotation.getTypeSignature())));
annotations[i] = new AnnotationX(annotation,world);
}
}
return hasMethod(type);
}
}
+
+ private final static String declareAtPrefix = "ajc$declare_at";
private boolean hasField(ResolvedType type) {
// TODO what about ITDs
World world = type.getWorld();
for (Iterator iter = type.getFields(); iter.hasNext();) {
Member field = (Member) iter.next();
+ if (field.getName().startsWith(declareAtPrefix)) continue;
if (signaturePattern.matches(field, type.getWorld(), false)) {
if (field.getDeclaringType().resolve(world) != type) {
if (Modifier.isPrivate(field.getModifiers())) continue;
World world = type.getWorld();
for (Iterator iter = type.getMethods(); iter.hasNext();) {
Member method = (Member) iter.next();
+ if (method.getName().startsWith(declareAtPrefix)) continue;
if (signaturePattern.matches(method, type.getWorld(), false)) {
if (method.getDeclaringType().resolve(world) != type) {
if (Modifier.isPrivate(method.getModifiers())) continue;