From 224e781cb556614cd65e463614ec2797ae644e49 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 27 Jul 2009 22:00:23 +0000 Subject: [PATCH] 282299: generics and declare parents - bridge method unrecognized --- .../aspectj/weaver/bcel/BcelTypeMunger.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 5c46ea24e..9286f3114 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -274,10 +274,19 @@ public class BcelTypeMunger extends ConcreteTypeMunger { List newParentTargetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true); for (Iterator ii = newParentTargetMethods.iterator(); ii.hasNext() && discoveredImpl == null;) { ResolvedMember gen2 = (ResolvedMember) ii.next(); - if (gen2.getName().equals(o.getName()) && gen2.getParameterSignature().equals(o.getParameterSignature()) - && !gen2.isAbstract()) { - discoveredImpl = gen2; // Found a valid - // implementation ! + if (gen2.getName().equals(o.getName()) && !gen2.isAbstract()) { + String oSig = o.getParameterSignature(); + // could be a match + if (gen2.getParameterSignature().equals(oSig)) { + discoveredImpl = gen2; + } else { + // Does the erasure match? In which case a bridge method will be created later to + // satisfy the abstract method + if (gen2.hasBackingGenericMember() + && gen2.getBackingGenericMember().getParameterSignature().equals(oSig)) { + discoveredImpl = gen2; + } + } } } if (discoveredImpl == null) { @@ -1146,7 +1155,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { * @param unMangledInterMethod the method to bridge 'to' that we have already created in the 'subtype' * @param clazz the class in which to put the bridge method * @param paramTypes Parameter types for the bridge method, passed in as an optimization since the caller is likely to have - * already created them. + * already created them. * @param theBridgeMethod */ private void createBridgeMethod(BcelWorld world, NewMethodTypeMunger munger, ResolvedMember unMangledInterMethod, -- 2.39.5