View | Details | Raw Unified | Return to bug 99553
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java (-4 / +10 lines)
Lines 156-165 Link Here
156
		}
156
		}
157
157
158
		// if generic type X<T> is referred to as parameterized X<T>, then answer itself
158
		// if generic type X<T> is referred to as parameterized X<T>, then answer itself
159
		boolean allEqual = true;
159
		boolean isIdentical = this.resolvedType instanceof SourceTypeBinding;
160
	    for (int i = 0; allEqual && i < argLength; i++)
160
		if (isIdentical) {
161
			allEqual = typeVariables[i] == argTypes[i];
161
		    for (int i = 0; i < argLength; i++) {
162
	    if (!allEqual) {
162
				if (typeVariables[i] != argTypes[i]) {
163
					isIdentical = false;
164
				    break;
165
				}
166
			}
167
		}		
168
	    if (!isIdentical) {
163
	    	ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), argTypes, enclosingType);
169
	    	ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType((ReferenceBinding)currentType.erasure(), argTypes, enclosingType);
164
			// check argument type compatibility
170
			// check argument type compatibility
165
			if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
171
			if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-1 / +4 lines)
Lines 177-183 Link Here
177
				}
177
				}
178
				if (substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing) {
178
				if (substitutedArguments != originalArguments || substitutedEnclosing != originalEnclosing) {
179
					identicalVariables: { // if substituted with original variables, then answer the generic type itself
179
					identicalVariables: { // if substituted with original variables, then answer the generic type itself
180
						if (substitutedEnclosing != originalEnclosing) break identicalVariables;
180
						if (substitutedEnclosing != null) {
181
							if (!(substitutedEnclosing instanceof SourceTypeBinding)) break identicalVariables;
182
							if (substitutedEnclosing != originalEnclosing) break identicalVariables;						
183
						}
181
						if (originalParameterizedType.type.isBinaryBinding()) break identicalVariables; // generic binary is never used as is, see 85262
184
						if (originalParameterizedType.type.isBinaryBinding()) break identicalVariables; // generic binary is never used as is, see 85262
182
						TypeVariableBinding[] originalVariables = originalParameterizedType.type.typeVariables();
185
						TypeVariableBinding[] originalVariables = originalParameterizedType.type.typeVariables();
183
						for (int i = 0, length = originalVariables.length; i < length; i++) {
186
						for (int i = 0, length = originalVariables.length; i < length; i++) {

Return to bug 99553