### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: dom/org/eclipse/jdt/core/dom/TypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java,v retrieving revision 1.119 diff -u -r1.119 TypeBinding.java --- dom/org/eclipse/jdt/core/dom/TypeBinding.java 15 Aug 2006 15:59:12 -0000 1.119 +++ dom/org/eclipse/jdt/core/dom/TypeBinding.java 7 Feb 2007 18:25:06 -0000 @@ -255,7 +255,11 @@ int length = members.length; ITypeBinding[] newMembers = new ITypeBinding[length]; for (int i = 0; i < length; i++) { - newMembers[i] = this.resolver.getTypeBinding(members[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(members[i]); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + newMembers[i] = typeBinding; } return newMembers; } @@ -406,7 +410,11 @@ } else { ITypeBinding[] newInterfaces = new ITypeBinding[length]; for (int i = 0; i < length; i++) { - newInterfaces[i] = this.resolver.getTypeBinding(interfaces[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(interfaces[i]); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + newInterfaces[i] = typeBinding; } return newInterfaces; } @@ -484,7 +492,9 @@ IMethod declaringMethod = (IMethod) declaringTypeBinding.getJavaElement(); return (JavaElement) declaringMethod.getTypeParameter(typeVariableName); } else { - declaringTypeBinding = this.resolver.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement); + ITypeBinding typeBinding2 = this.resolver.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement); + if (typeBinding == null) return null; + declaringTypeBinding = typeBinding2; IType declaringType = (IType) declaringTypeBinding.getJavaElement(); return (JavaElement) declaringType.getTypeParameter(typeVariableName); } @@ -841,7 +851,11 @@ int argumentsLength = arguments.length; ITypeBinding[] typeArguments = new ITypeBinding[argumentsLength]; for (int i = 0; i < argumentsLength; i++) { - typeArguments[i] = this.resolver.getTypeBinding(arguments[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(arguments[i]); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + typeArguments[i] = typeBinding; } return typeArguments; } @@ -877,11 +891,19 @@ ITypeBinding[] typeBounds = new ITypeBinding[boundsLength]; int boundsIndex = 0; if (firstClassOrArrayBound != null) { - typeBounds[boundsIndex++] = this.resolver.getTypeBinding(firstClassOrArrayBound); + ITypeBinding typeBinding = this.resolver.getTypeBinding(firstClassOrArrayBound); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + typeBounds[boundsIndex++] = typeBinding; } if (superinterfaces != null) { for (int i = 0; i < superinterfacesLength; i++, boundsIndex++) { - typeBounds[boundsIndex] = this.resolver.getTypeBinding(superinterfaces[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(superinterfaces[i]); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + typeBounds[boundsIndex] = typeBinding; } } return typeBounds; @@ -905,7 +927,11 @@ if (typeVariableBindingsLength != 0) { ITypeBinding[] typeParameters = new ITypeBinding[typeVariableBindingsLength]; for (int i = 0; i < typeVariableBindingsLength; i++) { - typeParameters[i] = this.resolver.getTypeBinding(typeVariableBindings[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(typeVariableBindings[i]); + if (typeBinding == null) { + return NO_TYPE_BINDINGS; + } + typeParameters[i] = typeBinding; } return typeParameters; } Index: dom/org/eclipse/jdt/core/dom/MethodBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java,v retrieving revision 1.79 diff -u -r1.79 MethodBinding.java --- dom/org/eclipse/jdt/core/dom/MethodBinding.java 24 Nov 2006 01:32:03 -0000 1.79 +++ dom/org/eclipse/jdt/core/dom/MethodBinding.java 7 Feb 2007 18:25:06 -0000 @@ -160,7 +160,11 @@ for (int i = 0; i < length; i++) { final TypeBinding parameterBinding = parameters[i]; if (parameterBinding != null) { - this.parameterTypes[i] = this.resolver.getTypeBinding(parameterBinding); + ITypeBinding typeBinding = this.resolver.getTypeBinding(parameterBinding); + if (typeBinding == null) { + return this.parameterTypes = NO_TYPE_BINDINGS; + } + this.parameterTypes[i] = typeBinding; } else { // log error StringBuffer message = new StringBuffer("Report method binding where a parameter is null:\n"); //$NON-NLS-1$ @@ -204,7 +208,11 @@ } else { this.exceptionTypes = new ITypeBinding[length]; for (int i = 0; i < length; i++) { - this.exceptionTypes[i] = this.resolver.getTypeBinding(exceptions[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(exceptions[i]); + if (typeBinding == null) { + return this.exceptionTypes = NO_TYPE_BINDINGS; + } + this.exceptionTypes[i] = typeBinding; } } return this.exceptionTypes; @@ -361,7 +369,11 @@ if (typeVariableBindingsLength != 0) { this.typeParameters = new ITypeBinding[typeVariableBindingsLength]; for (int i = 0; i < typeVariableBindingsLength; i++) { - typeParameters[i] = this.resolver.getTypeBinding(typeVariableBindings[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(typeVariableBindings[i]); + if (typeBinding == null) { + return this.typeParameters = NO_TYPE_BINDINGS; + } + typeParameters[i] = typeBinding; } } else { this.typeParameters = NO_TYPE_BINDINGS; @@ -401,7 +413,11 @@ if (typeArgumentsLength != 0) { this.typeArguments = new ITypeBinding[typeArgumentsLength]; for (int i = 0; i < typeArgumentsLength; i++) { - this.typeArguments[i] = this.resolver.getTypeBinding(typeArgumentsBindings[i]); + ITypeBinding typeBinding = this.resolver.getTypeBinding(typeArgumentsBindings[i]); + if (typeBinding == null) { + return this.typeArguments = NO_TYPE_BINDINGS; + } + this.typeArguments[i] = typeBinding; } } else { this.typeArguments = NO_TYPE_BINDINGS;