summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2008-12-04 16:29:18 +0000
committeraclement <aclement>2008-12-04 16:29:18 +0000
commit024421468c163588ec7d2d2d5dfa13b8dea4bb1e (patch)
tree238fc8afbcfc59b7954b557ce691111ff5628608 /weaver
parent4ab5683130ed30b559b9437a14abe194f06aa20e (diff)
downloadaspectj-024421468c163588ec7d2d2d5dfa13b8dea4bb1e.tar.gz
aspectj-024421468c163588ec7d2d2d5dfa13b8dea4bb1e.zip
commented out solution to mixin problem
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
index be2bc45e8..36c1ee6f1 100644
--- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
+++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
@@ -52,6 +52,7 @@ import org.aspectj.weaver.MethodDelegateTypeMunger;
import org.aspectj.weaver.NameMangler;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
+import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
@@ -711,8 +712,21 @@ public class AtAjAttributes {
// return false;
// }
hasAtLeastOneMethod = true;
- MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType,
- defaultImplClassName, typePattern);
+ // What we are saying here:
+ // We have this method 'method' and we want to put a forwarding method into a type that matches
+ // typePattern that should delegate to the version of the method in 'defaultImplClassName'
+
+ // Now the method may be from a supertype but the declaring type of the method we pass into the type
+ // munger is what is used to determine the type of the field that hosts the delegate instance.
+ // So here we create a modified method with an alternative declaring type so that we lookup
+ // the right field. See pr164016. Generics will probably break this horribly
+/*
+ ResolvedMemberImpl methodWithAlteredDeclaringType = new ResolvedMemberImpl(method.getKind(), fieldType,
+ method.getModifiers(), method.getReturnType(), method.getName(), method.getParameterTypes(),
+ method.getExceptions());
+*/
+ MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method,
+ struct.enclosingType, defaultImplClassName, typePattern);
mdtm.setSourceLocation(struct.enclosingType.getSourceLocation());
struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm));
}