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

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +36 lines)
Lines 1162-1167 Link Here
1162
					break;
1162
					break;
1163
			}
1163
			}
1164
		}
1164
		}
1165
		
1166
		if (isForbiddenType(packageName, simpleTypeName)) {
1167
			return;
1168
		}
1165
1169
1166
		if(this.acceptedTypes == null) {
1170
		if(this.acceptedTypes == null) {
1167
			this.acceptedTypes = new ObjectVector();
1171
			this.acceptedTypes = new ObjectVector();
Lines 3783-3794 Link Here
3783
			}
3787
			}
3784
			TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
3788
			TypeReference[] superInterfaces = typeDeclaration.superInterfaces;
3785
			int length = superInterfaces == null ? 0 : superInterfaces.length;
3789
			int length = superInterfaces == null ? 0 : superInterfaces.length;
3790
			int astNodeIndex = -1;
3786
			for (int i = 0; i < length; i++) {
3791
			for (int i = 0; i < length; i++) {
3787
				if(superInterfaces[i] == astNode) {
3792
				if(superInterfaces[i] == astNode) {
3788
					addForbiddenBindings(typeDeclaration.binding);
3793
					addForbiddenBindings(typeDeclaration.binding);
3789
					return scope.parent;
3794
					astNodeIndex = i;
3795
					break;
3790
				}
3796
				}
3791
			}
3797
			}
3798
			if (astNodeIndex >= 0) {
3799
				// Need to loop only up to astNodeIndex as the rest will be undefined.
3800
				for (int i = 0; i < astNodeIndex; i++) {
3801
					addForbiddenBindings(superInterfaces[i].resolvedType);
3802
				}
3803
				return scope.parent;
3804
			}
3792
		} else {
3805
		} else {
3793
			if (astNodeParent != null && astNodeParent instanceof TryStatement) {
3806
			if (astNodeParent != null && astNodeParent instanceof TryStatement) {
3794
				boolean isException = false;
3807
				boolean isException = false;
Lines 10325-10330 Link Here
10325
				checkCancel();
10338
				checkCancel();
10326
				
10339
				
10327
				SourceTypeBinding sourceType = types[i];
10340
				SourceTypeBinding sourceType = types[i];
10341
				
10342
				if (isForbidden(sourceType)) continue;
10328
10343
10329
				char[] qualifiedSourceTypeName = CharOperation.concatWith(sourceType.compoundName, '.');
10344
				char[] qualifiedSourceTypeName = CharOperation.concatWith(sourceType.compoundName, '.');
10330
10345
Lines 11673-11678 Link Here
11673
		return false;
11688
		return false;
11674
	}
11689
	}
11675
11690
11691
	private boolean isForbiddenType(char[] givenPkgName, char[] givenTypeName) {
11692
		for (int i = 0; i <= this.forbbidenBindingsPtr; i++) {
11693
			if (this.forbbidenBindings[i] instanceof TypeBinding) {
11694
				TypeBinding typeBinding = (TypeBinding) this.forbbidenBindings[i];
11695
				char[] currPkgName = typeBinding.qualifiedPackageName();
11696
				if (CharOperation.equals(givenPkgName, currPkgName))	{
11697
					char[] currTypeName = typeBinding.shortReadableName();
11698
					int genericTypePos = CharOperation.indexOf('<', currTypeName);
11699
					if (genericTypePos >= 0) {
11700
						currTypeName = CharOperation.subarray(currTypeName, 0, genericTypePos);
11701
					}
11702
					if (CharOperation.equals(givenTypeName, currTypeName)) {
11703
						return true;
11704
					}
11705
				}
11706
			}
11707
		}
11708
		return false;
11709
	}
11710
11676
	private boolean isIgnored(int kind) {
11711
	private boolean isIgnored(int kind) {
11677
		return this.requestor.isIgnored(kind);
11712
		return this.requestor.isIgnored(kind);
11678
	}
11713
	}

Return to bug 276526