From f1c208cb83fbbe4aa9c6a218dce9023903885b19 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 31 Jan 2005 13:15:38 +0000 Subject: [PATCH] Fix for hasAnnotation() - add the annotation type through the standard route rather than 'by hand' --- weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java index d32d54a6c..dcbdf226d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java @@ -18,6 +18,7 @@ import org.aspectj.apache.bcel.generic.InstructionFactory; import org.aspectj.apache.bcel.generic.InstructionHandle; import org.aspectj.apache.bcel.generic.InstructionList; import org.aspectj.apache.bcel.generic.LDC_W; +import org.aspectj.apache.bcel.generic.ObjectType; import org.aspectj.apache.bcel.generic.ReferenceType; import org.aspectj.apache.bcel.generic.Type; import org.aspectj.weaver.BCException; @@ -186,8 +187,9 @@ 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 - int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature()); - il.append(new LDC_W(annClassIndex)); + il.append(fact.createConstant(new ObjectType(hasAnnotation.getAnnotationType().getClassName()))); +// int annClassIndex = fact.getConstantPool().addClass(hasAnnotation.getAnnotationType().getSignature()); +// il.append(new LDC_W(annClassIndex)); Member isAnnotationPresent = Member.method(TypeX.forName("java/lang/Class"),0, "isAnnotationPresent","(Ljava/lang/Class;)Z"); il.append(Utility.createInvoke(fact,world,isAnnotationPresent)); -- 2.39.5