View | Details | Raw Unified | Return to bug 174131
Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java (+3 lines)
Lines 74-79 Link Here
74
public boolean isException(){
74
public boolean isException(){
75
	return this.kind == K_EXCEPTION;
75
	return this.kind == K_EXCEPTION;
76
}
76
}
77
public boolean isSuperType(){
78
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
79
}
77
public StringBuffer printExpression(int indent, StringBuffer output){
80
public StringBuffer printExpression(int indent, StringBuffer output){
78
	switch (this.kind) {
81
	switch (this.kind) {
79
		case K_CLASS :
82
		case K_CLASS :
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java (+4 lines)
Lines 73-78 Link Here
73
public boolean isException(){
73
public boolean isException(){
74
	return this.kind == K_EXCEPTION;
74
	return this.kind == K_EXCEPTION;
75
}
75
}
76
77
public boolean isSuperType(){
78
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
79
}
76
public StringBuffer printExpression(int indent, StringBuffer output) {
80
public StringBuffer printExpression(int indent, StringBuffer output) {
77
	switch (this.kind) {
81
	switch (this.kind) {
78
		case K_CLASS :
82
		case K_CLASS :
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java (+4 lines)
Lines 72-77 Link Here
72
		return this.kind == K_EXCEPTION;
72
		return this.kind == K_EXCEPTION;
73
	}
73
	}
74
	
74
	
75
	public boolean isSuperType(){
76
		return this.kind == K_CLASS || this.kind == K_INTERFACE;
77
	}
78
	
75
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
79
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
76
		super.resolveType(scope, checkBounds);
80
		super.resolveType(scope, checkBounds);
77
		throw new CompletionNodeFound(this, this.resolvedType, scope);
81
		throw new CompletionNodeFound(this, this.resolvedType, scope);
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-6 / +12 lines)
Lines 246-251 Link Here
246
	boolean assistNodeIsInterface;
246
	boolean assistNodeIsInterface;
247
	boolean assistNodeIsAnnotation;
247
	boolean assistNodeIsAnnotation;
248
	boolean assistNodeIsConstructor;
248
	boolean assistNodeIsConstructor;
249
	boolean assistNodeIsSuperType;
249
	int  assistNodeInJavadoc = 0;
250
	int  assistNodeInJavadoc = 0;
250
	boolean assistNodeCanBeSingleMemberAnnotation = false;
251
	boolean assistNodeCanBeSingleMemberAnnotation = false;
251
	
252
	
Lines 921-927 Link Here
921
			this.assistNodeIsException = singleRef.isException();
922
			this.assistNodeIsException = singleRef.isException();
922
			this.assistNodeIsInterface = singleRef.isInterface();
923
			this.assistNodeIsInterface = singleRef.isInterface();
923
			this.assistNodeIsConstructor = singleRef.isConstructorType;
924
			this.assistNodeIsConstructor = singleRef.isConstructorType;
924
925
			this.assistNodeIsSuperType = singleRef.isSuperType();
926
			
925
			// can be the start of a qualified type name
927
			// can be the start of a qualified type name
926
			if (qualifiedBinding == null) {
928
			if (qualifiedBinding == null) {
927
				if (this.completionToken.length == 0 &&
929
				if (this.completionToken.length == 0 &&
Lines 1115-1120 Link Here
1115
			this.assistNodeIsClass = ref.isClass();
1117
			this.assistNodeIsClass = ref.isClass();
1116
			this.assistNodeIsException = ref.isException();
1118
			this.assistNodeIsException = ref.isException();
1117
			this.assistNodeIsInterface = ref.isInterface();
1119
			this.assistNodeIsInterface = ref.isInterface();
1120
			this.assistNodeIsSuperType = ref.isSuperType();
1118
			
1121
			
1119
			this.completionToken = ref.completionIdentifier;
1122
			this.completionToken = ref.completionIdentifier;
1120
			long completionPosition = ref.sourcePositions[ref.tokens.length];
1123
			long completionPosition = ref.sourcePositions[ref.tokens.length];
Lines 1354-1359 Link Here
1354
				this.assistNodeIsClass = ref.isClass();
1357
				this.assistNodeIsClass = ref.isClass();
1355
				this.assistNodeIsException = ref.isException();
1358
				this.assistNodeIsException = ref.isException();
1356
				this.assistNodeIsInterface = ref.isInterface();
1359
				this.assistNodeIsInterface = ref.isInterface();
1360
				this.assistNodeIsSuperType = ref.isSuperType();
1357
				
1361
				
1358
				this.completionToken = ref.completionIdentifier;
1362
				this.completionToken = ref.completionIdentifier;
1359
				long completionPosition = ref.sourcePositions[ref.tokens.length];
1363
				long completionPosition = ref.sourcePositions[ref.tokens.length];
Lines 4307-4315 Link Here
4307
		if (typeName == null)
4311
		if (typeName == null)
4308
			return;
4312
			return;
4309
4313
4310
		if (currentType.superInterfaces() == null)
4314
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
4311
			return; // we're trying to find a supertype
4315
			
4312
4316
		if (currentType.superInterfaces() == null) return;
4317
		
4313
		if (this.insideQualifiedReference
4318
		if (this.insideQualifiedReference
4314
			|| typeName.length == 0) { // do not search up the hierarchy
4319
			|| typeName.length == 0) { // do not search up the hierarchy
4315
4320
Lines 4463-4471 Link Here
4463
		if (typeName == null || typeName.length == 0)
4468
		if (typeName == null || typeName.length == 0)
4464
			return;
4469
			return;
4465
4470
4466
		if (currentType.superInterfaces() == null)
4471
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference) return; // we're trying to find a supertype
4467
			return; // we're trying to find a supertype
4468
		
4472
		
4473
		if (currentType.superInterfaces() == null) return;
4474
		 
4469
		findMemberTypes(
4475
		findMemberTypes(
4470
				typeName,
4476
				typeName,
4471
				currentType.memberTypes(),
4477
				currentType.memberTypes(),
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (-1 lines)
Lines 3946-3952 Link Here
3946
	this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
3946
	this.wc.codeComplete(cursorLocation, requestor, this.wcOwner);
3947
3947
3948
	assertResults(
3948
	assertResults(
3949
			"CompletionInsideExtends10.CompletionInsideExtends10Inner.CompletionInsideExtends10InnerInner[TYPE_REF]{test.CompletionInsideExtends10.CompletionInsideExtends10Inner.CompletionInsideExtends10InnerInner, test, Ltest.CompletionInsideExtends10$CompletionInsideExtends10Inner$CompletionInsideExtends10InnerInner;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_NON_RESTRICTED) + "}\n" +
3950
			"CompletionInsideExtends10[TYPE_REF]{CompletionInsideExtends10, test, Ltest.CompletionInsideExtends10;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
3949
			"CompletionInsideExtends10[TYPE_REF]{CompletionInsideExtends10, test, Ltest.CompletionInsideExtends10;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" +
3951
			"CompletionInsideExtends10TopLevel[TYPE_REF]{CompletionInsideExtends10TopLevel, test, Ltest.CompletionInsideExtends10TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
3950
			"CompletionInsideExtends10TopLevel[TYPE_REF]{CompletionInsideExtends10TopLevel, test, Ltest.CompletionInsideExtends10TopLevel;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CLASS + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
3952
			requestor.getResults());
3951
			requestor.getResults());

Return to bug 174131