diff options
author | aclement <aclement> | 2005-01-24 09:38:48 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-01-24 09:38:48 +0000 |
commit | 9367b36e48a91755c82acee5693aae2980de3ded (patch) | |
tree | bfe67e802fcfe7cc7e885b4b4b8a808bded08959 /weaver | |
parent | 1076c8361630be6441f26d561b20f3116529db96 (diff) | |
download | aspectj-9367b36e48a91755c82acee5693aae2980de3ded.tar.gz aspectj-9367b36e48a91755c82acee5693aae2980de3ded.zip |
Fix to ensure woven methods don't lose their annotations.
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index 5da038ef6..f4b24adff 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -49,6 +49,7 @@ import org.aspectj.apache.bcel.generic.MethodGen; import org.aspectj.apache.bcel.generic.ObjectType; import org.aspectj.apache.bcel.generic.Select; import org.aspectj.apache.bcel.generic.Type; +import org.aspectj.apache.bcel.generic.annotation.AnnotationGen; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.weaver.AjAttribute; @@ -82,6 +83,7 @@ public final class LazyMethodGen { private String[] declaredExceptions; private InstructionList body; // leaving null for abstracts private Attribute[] attributes; + private AnnotationGen[] annotations; /* private */ final LazyClassGen enclosingClass; private final BcelMethod memberView; int highestLineNumber = 0; @@ -188,6 +190,7 @@ public final class LazyMethodGen { this.declaredExceptions = gen.getExceptions(); this.attributes = gen.getAttributes(); + this.annotations = gen.getAnnotations(); this.maxLocals = gen.getMaxLocals(); // this.returnType = BcelWorld.makeBcelType(memberView.getReturnType()); @@ -777,10 +780,17 @@ public final class LazyMethodGen { for (int i = 0, len = declaredExceptions.length; i < len; i++) { gen.addException(declaredExceptions[i]); } + for (int i = 0, len = attributes.length; i < len; i++) { gen.addAttribute(attributes[i]); } + if (annotations!=null) { + for (int i = 0, len = annotations.length; i < len; i++) { + gen.addAnnotation(annotations[i]); + } + } + if (isSynthetic) { ConstantPoolGen cpg = gen.getConstantPool(); int index = cpg.addUtf8("Synthetic"); |