From: aclement Date: Wed, 25 Jan 2006 10:32:05 +0000 (+0000) Subject: test and fix for 125080 - mixing numbers of types in a generic type hierarchy X-Git-Tag: POST_MEMORY_CHANGES~155 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8ce00642b4c8b1bb0233125e64f798283ebb3e90;p=aspectj.git test and fix for 125080 - mixing numbers of types in a generic type hierarchy --- diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java index 907d46a12..0cab45745 100644 --- a/weaver/src/org/aspectj/weaver/ReferenceType.java +++ b/weaver/src/org/aspectj/weaver/ReferenceType.java @@ -386,28 +386,14 @@ public class ReferenceType extends ResolvedType { UnresolvedType[] paramTypes = getTypesForMemberParameterization(); parameterizedInterfaces = new ResolvedType[delegateInterfaces.length]; for (int i = 0; i < delegateInterfaces.length; i++) { - // We may have to subset the set of parametertypes if the implemented interface - // needs less than this type does. (pr124803) + // We may have to sub/super set the set of parametertypes if the implemented interface + // needs more or less than this type does. (pr124803/pr125080) - // wonder if this could be done with getMemberParameterizationMap() like it is in getSuperclass()?? Something like: -// parameterizedInterfaces[i] = delegateInterfaces[i].parameterize(getMemberParameterizationMap()).resolve(world); - TypeVariable[] tvarsOnImplementedInterface = delegateInterfaces[i].getTypeVariables(); - TypeVariable[] tvarsOnThisGenericType = this.genericType.getTypeVariables(); - ResolvedType parameterizedInterface = null; - if (tvarsOnImplementedInterface!=null && tvarsOnThisGenericType!=null) { - if (tvarsOnImplementedInterface.length' where thisGenericType is something like 'Generic' - // we need to subset the type parameters based on their name - UnresolvedType[] subsetParameterTypes = new ResolvedType[tvarsOnImplementedInterface.length]; - for (int j = 0; j < subsetParameterTypes.length; j++) { - subsetParameterTypes[j] = findTypeParameterInList(tvarsOnImplementedInterface[j].getName(),tvarsOnThisGenericType,paramTypes); - } - parameterizedInterface = delegateInterfaces[i].parameterizedWith(subsetParameterTypes); - } + if (delegateInterfaces[i].isParameterizedType()) { + parameterizedInterfaces[i] = delegateInterfaces[i].parameterize(getMemberParameterizationMap()).resolve(world); + } else { + parameterizedInterfaces[i] = delegateInterfaces[i]; } - if (parameterizedInterface==null) parameterizedInterface = delegateInterfaces[i].parameterizedWith(paramTypes); - - parameterizedInterfaces[i] = parameterizedInterface; } return parameterizedInterfaces; } else if (isRawType()){