diff options
author | aclement <aclement> | 2005-11-21 15:58:39 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-21 15:58:39 +0000 |
commit | 0165ecdffb0551ae055652c4ac45903c0cbe7c91 (patch) | |
tree | fdddaf0c68e152fe92e91b656d277fa66f73a52f /weaver | |
parent | 206ab1288754f4c324262667b936b2b0cc865caa (diff) | |
download | aspectj-0165ecdffb0551ae055652c4ac45903c0cbe7c91.tar.gz aspectj-0165ecdffb0551ae055652c4ac45903c0cbe7c91.zip |
pr115250: allows for parameterized advice and works with the generic form.
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index d91056bc0..e358d4dac 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -2012,6 +2012,11 @@ public class BcelShadow extends Shadow { // !!! THIS BLOCK OF CODE SHOULD BE IN A METHOD CALLED weaveAround(...); Member mungerSig = munger.getSignature(); + //Member originalSig = mungerSig; // If mungerSig is on a parameterized type, originalSig is the member on the generic type + if (mungerSig instanceof ResolvedMember) { + ResolvedMember rm = (ResolvedMember)mungerSig; + if (rm.hasBackingGenericMember()) mungerSig = rm.getBackingGenericMember(); + } ResolvedType declaringType = world.resolve(mungerSig.getDeclaringType(),true); if (declaringType == ResolvedType.MISSING) { IMessage msg = new Message( @@ -2021,7 +2026,7 @@ public class BcelShadow extends Shadow { world.getMessageHandler().handleMessage(msg); } //??? might want some checks here to give better errors - BcelObjectType ot = BcelWorld.getBcelObjectType(declaringType); + BcelObjectType ot = BcelWorld.getBcelObjectType((declaringType.isParameterizedType()?declaringType.getGenericType():declaringType)); LazyMethodGen adviceMethod = ot.getLazyClassGen().getLazyMethodGen(mungerSig); if (!adviceMethod.getCanInline()) { @@ -2142,7 +2147,7 @@ public class BcelShadow extends Shadow { LazyMethodGen localAdviceMethod = new LazyMethodGen( Modifier.PRIVATE | Modifier.FINAL | Modifier.STATIC, - adviceMethod.getReturnType(), + BcelWorld.makeBcelType(mungerSig.getReturnType()), adviceMethodName, parameterTypes, new String[0], @@ -2208,7 +2213,7 @@ public class BcelShadow extends Shadow { advice.append( Utility.createConversion( getFactory(), - BcelWorld.makeBcelType(munger.getSignature().getReturnType()), + BcelWorld.makeBcelType(mungerSig.getReturnType()), extractedMethod.getReturnType())); if (! isFallsThrough()) { advice.append(InstructionFactory.createReturn(extractedMethod.getReturnType())); |