aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2005-01-31 13:15:38 +0000
committeraclement <aclement>2005-01-31 13:15:38 +0000
commitf1c208cb83fbbe4aa9c6a218dce9023903885b19 (patch)
tree23dc4e196685a0f06f9b1fc124ea00f09b6d94cd /weaver
parentcd6ed0b524ae75f81cacf35589cce7ea8df78a29 (diff)
downloadaspectj-f1c208cb83fbbe4aa9c6a218dce9023903885b19.tar.gz
aspectj-f1c208cb83fbbe4aa9c6a218dce9023903885b19.zip
Fix for hasAnnotation() - add the annotation type through the standard route rather than 'by hand'
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelRenderer.java6
1 files 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));