### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.397 diff -u -r1.397 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 20 May 2009 15:25:54 -0000 1.397 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 3 Jun 2009 12:41:17 -0000 @@ -1162,6 +1162,10 @@ break; } } + + if (isForbiddenType(packageName, simpleTypeName)) { + return; + } if(this.acceptedTypes == null) { this.acceptedTypes = new ObjectVector(); @@ -3783,12 +3787,21 @@ } TypeReference[] superInterfaces = typeDeclaration.superInterfaces; int length = superInterfaces == null ? 0 : superInterfaces.length; + int astNodeIndex = -1; for (int i = 0; i < length; i++) { if(superInterfaces[i] == astNode) { addForbiddenBindings(typeDeclaration.binding); - return scope.parent; + astNodeIndex = i; + break; } } + if (astNodeIndex >= 0) { + for (int i = 0; i < length; i++) { + if (i == astNodeIndex) continue; + addForbiddenBindings(superInterfaces[i].resolvedType); + } + return scope.parent; + } } else { if (astNodeParent != null && astNodeParent instanceof TryStatement) { boolean isException = false; @@ -10325,6 +10338,8 @@ checkCancel(); SourceTypeBinding sourceType = types[i]; + + if (isForbidden(sourceType)) continue; char[] qualifiedSourceTypeName = CharOperation.concatWith(sourceType.compoundName, '.'); @@ -11673,6 +11688,26 @@ return false; } + private boolean isForbiddenType(char[] givenPkgName, char[] givenTypeName) { + for (int i = 0; i <= this.forbbidenBindingsPtr; i++) { + if (this.forbbidenBindings[i] instanceof TypeBinding) { + TypeBinding typeBinding = (TypeBinding) this.forbbidenBindings[i]; + char[] currPkgName = typeBinding.qualifiedPackageName(); + if (CharOperation.equals(givenPkgName, currPkgName)) { + char[] currTypeName = typeBinding.shortReadableName(); + int genericTypePos = CharOperation.indexOf('<', currTypeName); + if (genericTypePos >= 0) { + currTypeName = CharOperation.subarray(currTypeName, 0, genericTypePos); + } + if (CharOperation.equals(givenTypeName, currTypeName)) { + return true; + } + } + } + } + return false; + } + private boolean isIgnored(int kind) { return this.requestor.isIgnored(kind); }