View | Details | Raw Unified | Return to bug 207573 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-3 / +6 lines)
Lines 200-211 Link Here
200
	    ReferenceBinding[] substitutedTypes = originalTypes;
200
	    ReferenceBinding[] substitutedTypes = originalTypes;
201
	    for (int i = 0, length = originalTypes.length; i < length; i++) {
201
	    for (int i = 0, length = originalTypes.length; i < length; i++) {
202
	        ReferenceBinding originalType = originalTypes[i];
202
	        ReferenceBinding originalType = originalTypes[i];
203
	        ReferenceBinding substitutedParameter = (ReferenceBinding)substitute(substitution, originalType);
203
	        TypeBinding substitutedType = substitute(substitution, originalType);
204
	        if (substitutedParameter != originalType) {
204
	        if (!(substitutedType instanceof ReferenceBinding)) {
205
	        	return null; // impossible substitution
206
	        }
207
	        if (substitutedType != originalType) {
205
	            if (substitutedTypes == originalTypes) {
208
	            if (substitutedTypes == originalTypes) {
206
	                System.arraycopy(originalTypes, 0, substitutedTypes = new ReferenceBinding[length], 0, i);
209
	                System.arraycopy(originalTypes, 0, substitutedTypes = new ReferenceBinding[length], 0, i);
207
	            }
210
	            }
208
	            substitutedTypes[i] = substitutedParameter;
211
	            substitutedTypes[i] = (ReferenceBinding)substitutedType;
209
	        } else if (substitutedTypes != originalTypes) {
212
	        } else if (substitutedTypes != originalTypes) {
210
	            substitutedTypes[i] = originalType;
213
	            substitutedTypes[i] = originalType;
211
	        }
214
	        }
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java (+6 lines)
Lines 284-289 Link Here
284
	    this.thrownExceptions = Scope.substitute(this, 	ignoreRawTypeSubstitution 
284
	    this.thrownExceptions = Scope.substitute(this, 	ignoreRawTypeSubstitution 
285
	    									? originalMethod.thrownExceptions // no substitution if original was static
285
	    									? originalMethod.thrownExceptions // no substitution if original was static
286
	    									: Scope.substitute(rawType, originalMethod.thrownExceptions));
286
	    									: Scope.substitute(rawType, originalMethod.thrownExceptions));
287
	    // error case where exception type variable would have been substituted by a non-reference type (207573)
288
	    if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS;	    
287
	    this.returnType = Scope.substitute(this, ignoreRawTypeSubstitution 
289
	    this.returnType = Scope.substitute(this, ignoreRawTypeSubstitution 
288
	    									? originalMethod.returnType // no substitution if original was static
290
	    									? originalMethod.returnType // no substitution if original was static
289
	    									: Scope.substitute(rawType, originalMethod.returnType));
291
	    									: Scope.substitute(rawType, originalMethod.returnType));
Lines 306-311 Link Here
306
	    this.originalMethod = originalMethod;
308
	    this.originalMethod = originalMethod;
307
	    this.parameters = Scope.substitute(this, originalMethod.parameters);
309
	    this.parameters = Scope.substitute(this, originalMethod.parameters);
308
	    this.thrownExceptions = Scope.substitute(this, originalMethod.thrownExceptions);
310
	    this.thrownExceptions = Scope.substitute(this, originalMethod.thrownExceptions);
311
	    // error case where exception type variable would have been substituted by a non-reference type (207573)
312
	    if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS;	    
309
	    this.returnType = Scope.substitute(this, originalMethod.returnType);
313
	    this.returnType = Scope.substitute(this, originalMethod.returnType);
310
	    this.wasInferred = true;// resulting from method invocation inferrence
314
	    this.wasInferred = true;// resulting from method invocation inferrence
311
	}
315
	}
Lines 432-437 Link Here
432
		this.inferredReturnType = inferenceContext.hasExplicitExpectedType && this.returnType != oldReturnType;
436
		this.inferredReturnType = inferenceContext.hasExplicitExpectedType && this.returnType != oldReturnType;
433
	    this.parameters = Scope.substitute(this, this.parameters);
437
	    this.parameters = Scope.substitute(this, this.parameters);
434
	    this.thrownExceptions = Scope.substitute(this, this.thrownExceptions);
438
	    this.thrownExceptions = Scope.substitute(this, this.thrownExceptions);
439
	    // error case where exception type variable would have been substituted by a non-reference type (207573)
440
	    if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS;
435
	    return this;
441
	    return this;
436
	}
442
	}
437
443

Return to bug 207573