]> source.dussan.org Git - aspectj.git/commitdiff
Fix for hasAnnotation() - add the annotation type through the standard route rather...
authoraclement <aclement>
Mon, 31 Jan 2005 13:15:38 +0000 (13:15 +0000)
committeraclement <aclement>
Mon, 31 Jan 2005 13:15:38 +0000 (13:15 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java

index d32d54a6c185c3e204b586eef52e47a779dc75af..dcbdf226d24d484ebec9cf91ef24a4f533156f97 100644 (file)
@@ -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));