diff options
author | aclement <aclement> | 2005-08-08 09:54:54 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-08-08 09:54:54 +0000 |
commit | 211806608a60557fb6180d55f9c9802a79ab490d (patch) | |
tree | fd0f1d15a449dca5dfafb667554ec1202e54dfcc /org.aspectj.ajdt.core | |
parent | 64f0a5bd91915a3c626a49841c9e4eb64d7f6de9 (diff) | |
download | aspectj-211806608a60557fb6180d55f9c9802a79ab490d.tar.gz aspectj-211806608a60557fb6180d55f9c9802a79ab490d.zip |
Fix for pr98901: copying annotations to new members created via ITD !!
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java index 21c5f2106..cac14243d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeMethodDeclaration.java @@ -156,9 +156,10 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { classFile.extraAttributes.add(new EclipseAttributeAdapter(makeAttribute())); if (!Modifier.isAbstract(declaredModifiers)) { - super.generateCode(classScope, classFile); + super.generateCode(classScope, classFile); // this makes the interMethodBody } + // annotations on the ITD declaration get put on this method generateDispatchMethod(classScope, classFile); } @@ -176,7 +177,13 @@ public class InterTypeMethodDeclaration extends InterTypeDeclaration { classFile.generateMethodInfoHeader(dispatchBinding); int methodAttributeOffset = classFile.contentsOffset; - int attributeNumber = classFile.generateMethodInfoAttribute(dispatchBinding, + + + // Watch out! We are passing in 'binding' here (instead of dispatchBinding) so that + // the dispatch binding attributes will include the annotations from the 'binding'. + // There is a chance that something else on the binding (e.g. throws clause) might + // damage the attributes generated for the dispatch binding. + int attributeNumber = classFile.generateMethodInfoAttribute(binding, false, makeEffectiveSignatureAttribute(signature, Shadow.MethodCall, false)); int codeAttributeOffset = classFile.contentsOffset; |