From 8ce00642b4c8b1bb0233125e64f798283ebb3e90 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 25 Jan 2006 10:32:05 +0000 Subject: [PATCH] test and fix for 125080 - mixing numbers of types in a generic type hierarchy --- .../src/org/aspectj/weaver/ReferenceType.java | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) 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()){ -- 2.39.5