aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-01-31 13:18:35 +0000
committeraclement <aclement>2005-01-31 13:18:35 +0000
commitb165e9deab89ff1e9d3f0ed20aeee49f15e89c76 (patch)
tree7623252df5a9960f14d220c2dfb015e42c88355f
parentf1c208cb83fbbe4aa9c6a218dce9023903885b19 (diff)
downloadaspectj-b165e9deab89ff1e9d3f0ed20aeee49f15e89c76.tar.gz
aspectj-b165e9deab89ff1e9d3f0ed20aeee49f15e89c76.zip
Fix for annotation resolution - allow for package names!
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
index b4a67924b..64dac28ff 100644
--- a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
+++ b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
@@ -116,7 +116,22 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern {
return this;
}
} else {
- annotationType = annotationType.resolve(scope.getWorld());
+ // Non binding case
+
+ String cleanname = annotationType.getClassName();
+ annotationType = scope.getWorld().resolve(annotationType,true);
+
+ // We may not have found it if it is in a package, lets look it up...
+ if (annotationType == ResolvedTypeX.MISSING) {
+ TypeX type = null;
+ while ((type = scope.lookupType(cleanname,this)) == ResolvedTypeX.MISSING) {
+ int lastDot = cleanname.lastIndexOf('.');
+ if (lastDot == -1) break;
+ cleanname = cleanname.substring(0,lastDot)+"$"+cleanname.substring(lastDot+1);
+ }
+ annotationType = scope.getWorld().resolve(type,true);
+ }
+
verifyIsAnnotationType(annotationType,scope);
return this;
}