aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2009-01-06 23:53:55 +0000
committeraclement <aclement>2009-01-06 23:53:55 +0000
commit5d2608b8ef08126f06e53c39384c6b9728633667 (patch)
tree7a8dfa29ab4f03a03452d4d517fb2fc9250bba32 /weaver
parenta99152466be89364c68ca43731445ba9ab7e3f26 (diff)
downloadaspectj-5d2608b8ef08126f06e53c39384c6b9728633667.tar.gz
aspectj-5d2608b8ef08126f06e53c39384c6b9728633667.zip
164016, 258788: test and fix
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java12
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java4
2 files changed, 6 insertions, 10 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
index c20334350..413c71c2e 100644
--- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
+++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
@@ -744,14 +744,10 @@ public class AtAjAttributes {
// 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());
- */
+ // the right field. See pr164016.
MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType,
defaultImplClassName, typePattern);
+ mdtm.setFieldType(fieldType);
mdtm.setSourceLocation(struct.enclosingType.getSourceLocation());
struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm));
}
@@ -759,9 +755,9 @@ public class AtAjAttributes {
// successfull so far, we thus need a bcel type munger to have
// a field hosting the mixin in the target type
if (hasAtLeastOneMethod && defaultImplClassName != null) {
+ ResolvedMember fieldHost = AjcMemberMaker.itdAtDeclareParentsField(null, fieldType, struct.enclosingType);
struct.ajAttributes.add(new AjAttribute.TypeMunger(new MethodDelegateTypeMunger.FieldHostTypeMunger(
- AjcMemberMaker.itdAtDeclareParentsField(null,// prototyped
- fieldType, struct.enclosingType), struct.enclosingType, typePattern)));
+ fieldHost, struct.enclosingType, typePattern)));
}
return true;
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index 524fa1e28..d34571af2 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -90,7 +90,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
changed = mungeNewField(weaver, (NewFieldTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.Method) {
changed = mungeNewMethod(weaver, (NewMethodTypeMunger) munger);
- } else if (munger.getKind() == ResolvedTypeMunger.MethodDelegate) {
+ } else if (munger.getKind() == ResolvedTypeMunger.MethodDelegate2) {
changed = mungeMethodDelegate(weaver, (MethodDelegateTypeMunger) munger);
} else if (munger.getKind() == ResolvedTypeMunger.FieldHost) {
changed = mungeFieldHost(weaver, (MethodDelegateTypeMunger.FieldHostTypeMunger) munger);
@@ -302,7 +302,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
satisfiedByITD = true;
}
}
- } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate) {
+ } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
satisfiedByITD = true;// AV - that should be
// enough, no need to
// check more