diff options
author | aclement <aclement> | 2006-01-25 10:32:05 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-01-25 10:32:05 +0000 |
commit | 8ce00642b4c8b1bb0233125e64f798283ebb3e90 (patch) | |
tree | 47392b55f78f847247e9afcd16023b415b94b74e /weaver | |
parent | 1f4956a4e31ac88bcc97a98da3f84c89413cd0a1 (diff) | |
download | aspectj-8ce00642b4c8b1bb0233125e64f798283ebb3e90.tar.gz aspectj-8ce00642b4c8b1bb0233125e64f798283ebb3e90.zip |
test and fix for 125080 - mixing numbers of types in a generic type hierarchy
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/ReferenceType.java | 26 |
1 files 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<tvarsOnThisGenericType.length) { - // implemented interface is something like 'Generic<T>' where thisGenericType is something like 'Generic<T,Y>' - // 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()){ |