From b165e9deab89ff1e9d3f0ed20aeee49f15e89c76 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 31 Jan 2005 13:18:35 +0000 Subject: [PATCH] Fix for annotation resolution - allow for package names! --- .../patterns/ExactAnnotationTypePattern.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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; } -- 2.39.5