### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.318 diff -u -r1.318 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 16 Oct 2007 10:24:16 -0000 1.318 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 30 Oct 2007 11:22:47 -0000 @@ -200,12 +200,15 @@ ReferenceBinding[] substitutedTypes = originalTypes; for (int i = 0, length = originalTypes.length; i < length; i++) { ReferenceBinding originalType = originalTypes[i]; - ReferenceBinding substitutedParameter = (ReferenceBinding)substitute(substitution, originalType); - if (substitutedParameter != originalType) { + TypeBinding substitutedType = substitute(substitution, originalType); + if (!(substitutedType instanceof ReferenceBinding)) { + return null; // impossible substitution + } + if (substitutedType != originalType) { if (substitutedTypes == originalTypes) { System.arraycopy(originalTypes, 0, substitutedTypes = new ReferenceBinding[length], 0, i); } - substitutedTypes[i] = substitutedParameter; + substitutedTypes[i] = (ReferenceBinding)substitutedType; } else if (substitutedTypes != originalTypes) { substitutedTypes[i] = originalType; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java,v retrieving revision 1.59 diff -u -r1.59 ParameterizedGenericMethodBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 12 Oct 2007 13:37:17 -0000 1.59 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 30 Oct 2007 11:22:47 -0000 @@ -284,6 +284,8 @@ this.thrownExceptions = Scope.substitute(this, ignoreRawTypeSubstitution ? originalMethod.thrownExceptions // no substitution if original was static : Scope.substitute(rawType, originalMethod.thrownExceptions)); + // error case where exception type variable would have been substituted by a non-reference type (207573) + if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; this.returnType = Scope.substitute(this, ignoreRawTypeSubstitution ? originalMethod.returnType // no substitution if original was static : Scope.substitute(rawType, originalMethod.returnType)); @@ -306,6 +308,8 @@ this.originalMethod = originalMethod; this.parameters = Scope.substitute(this, originalMethod.parameters); this.thrownExceptions = Scope.substitute(this, originalMethod.thrownExceptions); + // error case where exception type variable would have been substituted by a non-reference type (207573) + if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; this.returnType = Scope.substitute(this, originalMethod.returnType); this.wasInferred = true;// resulting from method invocation inferrence } @@ -432,6 +436,8 @@ this.inferredReturnType = inferenceContext.hasExplicitExpectedType && this.returnType != oldReturnType; this.parameters = Scope.substitute(this, this.parameters); this.thrownExceptions = Scope.substitute(this, this.thrownExceptions); + // error case where exception type variable would have been substituted by a non-reference type (207573) + if (this.thrownExceptions == null) this.thrownExceptions = Binding.NO_EXCEPTIONS; return this; }