From: aclement Date: Mon, 31 Jan 2005 13:15:38 +0000 (+0000) Subject: Fix for hasAnnotation() - add the annotation type through the standard route rather... X-Git-Tag: Root_AspectJ5_Development~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1c208cb83fbbe4aa9c6a218dce9023903885b19;p=aspectj.git Fix for hasAnnotation() - add the annotation type through the standard route rather than 'by hand' --- 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));