Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java,v retrieving revision 1.23 diff -u -r1.23 ParameterizedSingleTypeReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 4 Jun 2005 13:03:22 -0000 1.23 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 13 Jun 2005 13:37:09 -0000 @@ -156,10 +156,16 @@ } // if generic type X is referred to as parameterized X, then answer itself - boolean allEqual = true; - for (int i = 0; allEqual && i < argLength; i++) - allEqual = typeVariables[i] == argTypes[i]; - if (!allEqual) { + boolean isIdentical = this.resolvedType instanceof SourceTypeBinding; + if (isIdentical) { + for (int i = 0; i < argLength; i++) { + if (typeVariables[i] != argTypes[i]) { + isIdentical = false; + break; + } + } + } + if (!isIdentical) { ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), argTypes, enclosingType); // check argument type compatibility if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.227 diff -u -r1.227 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 10 Jun 2005 08:41:20 -0000 1.227 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 13 Jun 2005 13:37:12 -0000 @@ -177,7 +177,10 @@ } if (substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing) { identicalVariables: { // if substituted with original variables, then answer the generic type itself - if (substitutedEnclosing != originalEnclosing) break identicalVariables; + if (substitutedEnclosing != null) { + if (!(substitutedEnclosing instanceof SourceTypeBinding)) break identicalVariables; + if (substitutedEnclosing != originalEnclosing) break identicalVariables; + } if (originalParameterizedType.type.isBinaryBinding()) break identicalVariables; // generic binary is never used as is, see 85262 TypeVariableBinding[] originalVariables = originalParameterizedType.type.typeVariables(); for (int i = 0, length = originalVariables.length; i < length; i++) {