diff options
author | aclement <aclement> | 2004-08-13 14:48:43 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-13 14:48:43 +0000 |
commit | 98c78c9c39384fa1c4734097308e5b38f1f83072 (patch) | |
tree | 867979cccda29de754d6c2d4eff87d95e0e7cf14 /org.aspectj.ajdt.core | |
parent | 04e658c273b4bb0ecab65ab3b847c15f5b483988 (diff) | |
download | aspectj-98c78c9c39384fa1c4734097308e5b38f1f83072.tar.gz aspectj-98c78c9c39384fa1c4734097308e5b38f1f83072.zip |
Fix and tests for Bugzilla Bug 71372
NoSuchMethodError calling private method from around advice in inner aspect
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java index c913040fe..9840be79e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java @@ -170,16 +170,24 @@ public class AccessForInlineVisitor extends ASTVisitor { if (isPublic(binding)) return binding; if (binding instanceof InterTypeMethodBinding) return binding; + ResolvedMember m = null; if (binding.isPrivate() && binding.declaringClass != inAspect.binding) { + // does this always mean that the aspect is an inner aspect of the bindings + // declaring class? After all, the field is private but we can see it from + // where we are. binding.modifiers = AstUtil.makePackageVisible(binding.modifiers); + m = EclipseFactory.makeResolvedMember(binding); + } else { + // Sometimes receiverType and binding.declaringClass are *not* the same. + + // Sometimes receiverType is a subclass of binding.declaringClass. In these situations + // we want the generated inline accessor to call the method on the subclass (at + // runtime this will be satisfied by the super). + m = EclipseFactory.makeResolvedMember(binding, receiverType); } - - - ResolvedMember m = EclipseFactory.makeResolvedMember(binding, receiverType); if (inAspect.accessForInline.containsKey(m)) return (MethodBinding)inAspect.accessForInline.get(m); MethodBinding ret = world.makeMethodBinding( - AjcMemberMaker.inlineAccessMethodForMethod(inAspect.typeX, m) - ); + AjcMemberMaker.inlineAccessMethodForMethod(inAspect.typeX, m)); inAspect.accessForInline.put(m, ret); return ret; } |