diff options
author | aclement <aclement> | 2005-02-07 13:29:29 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-02-07 13:29:29 +0000 |
commit | ec8a423b7232747f9979dc48a69d05b2c399a6ec (patch) | |
tree | 5c13143a49c9119f2de11928da3a69dbc95e64fa /weaver | |
parent | 953fd4340f6eb6c578d591be9a0d601daf35ca6d (diff) | |
download | aspectj-ec8a423b7232747f9979dc48a69d05b2c399a6ec.tar.gz aspectj-ec8a423b7232747f9979dc48a69d05b2c399a6ec.zip |
Testcases and fix for using @target() when the annotation is in a package.
Diffstat (limited to 'weaver')
3 files changed, 4 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java index 5d8d432e8..553da757e 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java @@ -186,7 +186,8 @@ public class BcelRenderer implements ITestVisitor, IExprVisitor { Member getClass = Member.method(TypeX.OBJECT, 0, "getClass", "()Ljava/lang/Class;"); il.append(Utility.createInvoke(fact, world, getClass)); // aload annotationClass - il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getClassName()))); + String s = hasAnnotation.getAnnotationType().getName(); + il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getName()))); // int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature()); // il.append(new LDC_W(annClassIndex)); Member isAnnotationPresent = Member.method(TypeX.forName("java/lang/Class"),0, diff --git a/weaver/src/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java b/weaver/src/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java index c30e4ba58..3bcac2842 100644 --- a/weaver/src/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java +++ b/weaver/src/org/aspectj/weaver/bcel/TypeAnnotationAccessVar.java @@ -61,7 +61,7 @@ public class TypeAnnotationAccessVar extends BcelVar { Type jlaAnnotation = BcelWorld.makeBcelType(TypeX.forSignature("Ljava.lang.annotation.Annotation;")); il.append(target.createLoad(fact)); il.append(fact.createInvoke("java/lang/Object","getClass",jlClass,new Type[]{},Constants.INVOKEVIRTUAL)); - il.append(fact.createConstant(new ObjectType(toType.getClassName()))); + il.append(fact.createConstant(new ObjectType(toType.getName()))); il.append(fact.createInvoke("java/lang/Class","getAnnotation",jlaAnnotation,new Type[]{jlClass},Constants.INVOKEVIRTUAL)); il.append(Utility.createConversion(fact,jlaAnnotation,BcelWorld.makeBcelType(toType))); return il; diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java index 64dac28ff..23a36e84d 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java @@ -118,7 +118,7 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern { } else { // Non binding case - String cleanname = annotationType.getClassName(); + String cleanname = annotationType.getName(); annotationType = scope.getWorld().resolve(annotationType,true); // We may not have found it if it is in a package, lets look it up... |