diff options
author | Andy Clement <aclement@pivotal.io> | 2017-11-01 15:08:27 -0700 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2017-11-01 15:31:10 -0700 |
commit | 6765fdc34c775e99799b36d88cff8ab88dffc8e7 (patch) | |
tree | 13f35d56861a8685bd7bc20db34f3ae99a94bb91 /weaver | |
parent | dc89660c13270539cf9ff71d288086631a658665 (diff) | |
download | aspectj-6765fdc34c775e99799b36d88cff8ab88dffc8e7.tar.gz aspectj-6765fdc34c775e99799b36d88cff8ab88dffc8e7.zip |
Fix 526734 - Incorrect generic override decp validation when binary weaving
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 9768cb9e4..c82c352ae 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -352,8 +352,21 @@ public class BcelTypeMunger extends ConcreteTypeMunger { && targetMethod.getBackingGenericMember().getParameterSignature().equals(newParentMethodSig)) { discoveredImpl = targetMethod; } else if (newParentMethod.hasBackingGenericMember()) { - if (newParentMethod.getBackingGenericMember().getParameterSignature().equals(targetMethodSignature)) { + if (newParentMethod.getBackingGenericMember().getParameterSignature().equals(targetMethodSignature)) { // newParentMethod.getBackingGenericMember().getParameterSignature gives: (Pjava/util/List<TI;>;) targetMethodSignature= (Ljava/util/List;) discoveredImpl = targetMethod; + } else if (targetMethod instanceof BcelMethod) { + // BcelMethod does not have backing generic member set (need to investigate why). For now, special case here: + UnresolvedType[] targetMethodGenericParameterTypes = targetMethod.getGenericParameterTypes(); + if (targetMethodGenericParameterTypes !=null) { + StringBuilder b = new StringBuilder("("); + for (UnresolvedType p: targetMethodGenericParameterTypes) { + b.append(p.getSignature()); + } + b.append(')'); + if (b.toString().equals(newParentMethodSig)) { + discoveredImpl = targetMethod; + } + } } } } |