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

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-5 / +29 lines)
Lines 520-525 Link Here
520
	boolean assistNodeIsConstructor;
520
	boolean assistNodeIsConstructor;
521
	boolean assistNodeIsSuperType;
521
	boolean assistNodeIsSuperType;
522
	boolean assistNodeIsExtendedType;
522
	boolean assistNodeIsExtendedType;
523
	boolean assistNodeIsInterfaceExcludingAnnotations;
523
	int  assistNodeInJavadoc = 0;
524
	int  assistNodeInJavadoc = 0;
524
	boolean assistNodeCanBeSingleMemberAnnotation = false;
525
	boolean assistNodeCanBeSingleMemberAnnotation = false;
525
	
526
	
Lines 2774-2780 Link Here
2774
			CompletionOnParameterizedQualifiedTypeReference ref = (CompletionOnParameterizedQualifiedTypeReference) astNode;
2775
			CompletionOnParameterizedQualifiedTypeReference ref = (CompletionOnParameterizedQualifiedTypeReference) astNode;
2775
2776
2776
			this.insideQualifiedReference = true;
2777
			this.insideQualifiedReference = true;
2777
2778
			this.assistNodeIsInterfaceExcludingAnnotations = ref.isInterfaceExcludingAnnotations();
2778
			this.assistNodeIsClass = ref.isClass();
2779
			this.assistNodeIsClass = ref.isClass();
2779
			this.assistNodeIsException = ref.isException();
2780
			this.assistNodeIsException = ref.isException();
2780
			this.assistNodeIsInterface = ref.isInterface();
2781
			this.assistNodeIsInterface = ref.isInterface();
Lines 3041-3047 Link Here
3041
		this.assistNodeIsConstructor = ref.isConstructorType;
3042
		this.assistNodeIsConstructor = ref.isConstructorType;
3042
		this.assistNodeIsSuperType = ref.isSuperType();
3043
		this.assistNodeIsSuperType = ref.isSuperType();
3043
		this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
3044
		this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
3044
3045
		this.assistNodeIsInterfaceExcludingAnnotations = ref.isInterfaceExcludingAnnotations();
3045
		this.completionToken = ref.completionIdentifier;
3046
		this.completionToken = ref.completionIdentifier;
3046
		long completionPosition = ref.sourcePositions[ref.tokens.length];
3047
		long completionPosition = ref.sourcePositions[ref.tokens.length];
3047
3048
Lines 3175-3181 Link Here
3175
		this.assistNodeIsConstructor = singleRef.isConstructorType;
3176
		this.assistNodeIsConstructor = singleRef.isConstructorType;
3176
		this.assistNodeIsSuperType = singleRef.isSuperType();
3177
		this.assistNodeIsSuperType = singleRef.isSuperType();
3177
		this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
3178
		this.assistNodeIsExtendedType = assistNodeIsExtendedType(astNode, astNodeParent);
3178
3179
		this.assistNodeIsInterfaceExcludingAnnotations = singleRef.isInterfaceExcludingAnnotations(); // can only be an annotation if preceeded by EXTENDS
3179
		// can be the start of a qualified type name
3180
		// can be the start of a qualified type name
3180
		if (qualifiedBinding == null) {
3181
		if (qualifiedBinding == null) {
3181
			if (this.completionToken.length == 0 &&
3182
			if (this.completionToken.length == 0 &&
Lines 4038-4044 Link Here
4038
	}
4039
	}
4039
4040
4040
	private int computeRelevanceForInterface(){
4041
	private int computeRelevanceForInterface(){
4041
		if(this.assistNodeIsInterface) {
4042
		if(this.assistNodeIsInterface || this.assistNodeIsInterfaceExcludingAnnotations) {
4042
			return R_INTERFACE;
4043
			return R_INTERFACE;
4043
		}
4044
		}
4044
		return 0;
4045
		return 0;
Lines 9254-9259 Link Here
9254
					memberType.isStatic()) {
9255
					memberType.isStatic()) {
9255
				continue next;
9256
				continue next;
9256
			}
9257
			}
9258
			
9259
			if (this.assistNodeIsInterfaceExcludingAnnotations && memberType.isAnnotationType()) continue next;
9257
9260
9258
			for (int i = typesFound.size; --i >= 0;) {
9261
			for (int i = typesFound.size; --i >= 0;) {
9259
				ReferenceBinding otherType = (ReferenceBinding) typesFound.elementAt(i);
9262
				ReferenceBinding otherType = (ReferenceBinding) typesFound.elementAt(i);
Lines 9284-9289 Link Here
9284
			if(!this.insideQualifiedReference) {
9287
			if(!this.insideQualifiedReference) {
9285
				if(this.assistNodeIsClass) {
9288
				if(this.assistNodeIsClass) {
9286
					if(!memberType.isClass()) continue next;
9289
					if(!memberType.isClass()) continue next;
9290
				} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
9291
					if (!memberType.isInterface()) continue next;
9287
				} else if(this.assistNodeIsInterface) {
9292
				} else if(this.assistNodeIsInterface) {
9288
					if(!memberType.isInterface() && !memberType.isAnnotationType()) continue next;
9293
					if(!memberType.isInterface() && !memberType.isAnnotationType()) continue next;
9289
				} else if (this.assistNodeIsAnnotation) {
9294
				} else if (this.assistNodeIsAnnotation) {
Lines 9767-9776 Link Here
9767
									if (localType == otherType)
9772
									if (localType == otherType)
9768
										continue next;
9773
										continue next;
9769
								}
9774
								}
9775
								
9776
								if (this.assistNodeIsInterfaceExcludingAnnotations && localType.isAnnotationType()) continue next;
9770
9777
9771
								if (this.assistNodeIsExtendedType && localType.isFinal()) continue next;
9778
								if (this.assistNodeIsExtendedType && localType.isFinal()) continue next;
9772
								if(this.assistNodeIsClass) {
9779
								if(this.assistNodeIsClass) {
9773
									if(!localType.isClass()) continue next;
9780
									if(!localType.isClass()) continue next;
9781
								} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
9782
									if (!localType.isInterface()) continue next;
9774
								} else if(this.assistNodeIsInterface) {
9783
								} else if(this.assistNodeIsInterface) {
9775
									if(!localType.isInterface() && !localType.isAnnotationType()) continue next;
9784
									if(!localType.isInterface() && !localType.isAnnotationType()) continue next;
9776
								} else if (this.assistNodeIsAnnotation) {
9785
								} else if (this.assistNodeIsAnnotation) {
Lines 10081-10086 Link Here
10081
			
10090
			
10082
			findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
10091
			findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound);
10083
			if(!this.assistNodeIsInterface &&
10092
			if(!this.assistNodeIsInterface &&
10093
					!this.assistNodeIsInterfaceExcludingAnnotations &&
10084
					!this.assistNodeIsConstructor &&
10094
					!this.assistNodeIsConstructor &&
10085
					!this.assistNodeIsAnnotation &&
10095
					!this.assistNodeIsAnnotation &&
10086
					this.assistNodeInJavadoc == 0) {
10096
					this.assistNodeInJavadoc == 0) {
Lines 10115-10120 Link Here
10115
				SourceTypeBinding sourceType = types[i];
10125
				SourceTypeBinding sourceType = types[i];
10116
10126
10117
				if(isForbidden(sourceType)) continue next;
10127
				if(isForbidden(sourceType)) continue next;
10128
				
10129
				if (this.assistNodeIsInterfaceExcludingAnnotations && sourceType.isAnnotationType()) continue next;
10118
10130
10119
				if(proposeAllMemberTypes &&
10131
				if(proposeAllMemberTypes &&
10120
					sourceType != outerInvocationType) {
10132
					sourceType != outerInvocationType) {
Lines 10152-10157 Link Here
10152
				if (this.assistNodeIsExtendedType && sourceType.isFinal()) continue next;
10164
				if (this.assistNodeIsExtendedType && sourceType.isFinal()) continue next;
10153
				if(this.assistNodeIsClass) {
10165
				if(this.assistNodeIsClass) {
10154
					if(!sourceType.isClass()) continue next;
10166
					if(!sourceType.isClass()) continue next;
10167
				} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
10168
					if (!sourceType.isInterface()) continue next;
10155
				} else if(this.assistNodeIsInterface) {
10169
				} else if(this.assistNodeIsInterface) {
10156
					if(!sourceType.isInterface() && !sourceType.isAnnotationType()) continue next;
10170
					if(!sourceType.isInterface() && !sourceType.isAnnotationType()) continue next;
10157
				} else if (this.assistNodeIsAnnotation) {
10171
				} else if (this.assistNodeIsAnnotation) {
Lines 10283-10288 Link Here
10283
				int searchFor = IJavaSearchConstants.TYPE;
10297
				int searchFor = IJavaSearchConstants.TYPE;
10284
				if(this.assistNodeIsClass) {
10298
				if(this.assistNodeIsClass) {
10285
					searchFor = IJavaSearchConstants.CLASS;
10299
					searchFor = IJavaSearchConstants.CLASS;
10300
				} else if(this.assistNodeIsInterfaceExcludingAnnotations) {
10301
					searchFor = IJavaSearchConstants.INTERFACE;
10286
				} else if(this.assistNodeIsInterface) {
10302
				} else if(this.assistNodeIsInterface) {
10287
					searchFor = IJavaSearchConstants.INTERFACE_AND_ANNOTATION;
10303
					searchFor = IJavaSearchConstants.INTERFACE_AND_ANNOTATION;
10288
				} else if(this.assistNodeIsEnum) {
10304
				} else if(this.assistNodeIsEnum) {
Lines 10357-10363 Link Here
10357
				
10373
				
10358
				if (isForbidden(sourceType)) continue;
10374
				if (isForbidden(sourceType)) continue;
10359
				if (this.assistNodeIsClass && sourceType.isInterface()) continue;
10375
				if (this.assistNodeIsClass && sourceType.isInterface()) continue;
10360
				if (this.assistNodeIsInterface && sourceType.isClass()) continue;
10376
				if ((this.assistNodeIsInterface || this.assistNodeIsInterfaceExcludingAnnotations) && sourceType.isClass()) continue;
10361
10377
10362
				char[] qualifiedSourceTypeName = CharOperation.concatWith(sourceType.compoundName, '.');
10378
				char[] qualifiedSourceTypeName = CharOperation.concatWith(sourceType.compoundName, '.');
10363
10379
Lines 10462-10467 Link Here
10462
			int searchFor = IJavaSearchConstants.TYPE;
10478
			int searchFor = IJavaSearchConstants.TYPE;
10463
			if(this.assistNodeIsClass) {
10479
			if(this.assistNodeIsClass) {
10464
				searchFor = IJavaSearchConstants.CLASS;
10480
				searchFor = IJavaSearchConstants.CLASS;
10481
			} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
10482
				searchFor = IJavaSearchConstants.INTERFACE;
10465
			} else if(this.assistNodeIsInterface) {
10483
			} else if(this.assistNodeIsInterface) {
10466
				searchFor = IJavaSearchConstants.INTERFACE_AND_ANNOTATION;
10484
				searchFor = IJavaSearchConstants.INTERFACE_AND_ANNOTATION;
10467
			} else if(this.assistNodeIsEnum) {
10485
			} else if(this.assistNodeIsEnum) {
Lines 10570-10575 Link Here
10570
						if (this.assistNodeIsExtendedType && refBinding.isFinal()) continue next;
10588
						if (this.assistNodeIsExtendedType && refBinding.isFinal()) continue next;
10571
						if(this.assistNodeIsClass) {
10589
						if(this.assistNodeIsClass) {
10572
							if(!refBinding.isClass()) continue next;
10590
							if(!refBinding.isClass()) continue next;
10591
						} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
10592
							if (!refBinding.isInterface()) continue next;
10573
						} else if(this.assistNodeIsInterface) {
10593
						} else if(this.assistNodeIsInterface) {
10574
							if(!refBinding.isInterface() && !refBinding.isAnnotationType()) continue next;
10594
							if(!refBinding.isInterface() && !refBinding.isAnnotationType()) continue next;
10575
						} else if (this.assistNodeIsAnnotation) {
10595
						} else if (this.assistNodeIsAnnotation) {
Lines 10700-10705 Link Here
10700
							if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
10720
							if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
10701
							if(this.assistNodeIsClass) {
10721
							if(this.assistNodeIsClass) {
10702
								if(!typeBinding.isClass()) continue;
10722
								if(!typeBinding.isClass()) continue;
10723
							} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
10724
								if (!typeBinding.isInterface()) continue;
10703
							} else if(this.assistNodeIsInterface) {
10725
							} else if(this.assistNodeIsInterface) {
10704
								if(!typeBinding.isInterface() && !typeBinding.isAnnotationType()) continue;
10726
								if(!typeBinding.isInterface() && !typeBinding.isAnnotationType()) continue;
10705
							} else if (this.assistNodeIsAnnotation) {
10727
							} else if (this.assistNodeIsAnnotation) {
Lines 10803-10808 Link Here
10803
							if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
10825
							if (this.assistNodeIsExtendedType && typeBinding.isFinal()) continue;
10804
							if(this.assistNodeIsClass) {
10826
							if(this.assistNodeIsClass) {
10805
								if(!typeBinding.isClass()) continue;
10827
								if(!typeBinding.isClass()) continue;
10828
							} else if (this.assistNodeIsInterfaceExcludingAnnotations) {
10829
								if (!typeBinding.isInterface()) continue;
10806
							} else if(this.assistNodeIsInterface) {
10830
							} else if(this.assistNodeIsInterface) {
10807
								if(!typeBinding.isInterface() && !typeBinding.isAnnotationType()) continue;
10831
								if(!typeBinding.isInterface() && !typeBinding.isAnnotationType()) continue;
10808
							} else if (this.assistNodeIsAnnotation) {
10832
							} else if (this.assistNodeIsAnnotation) {
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java (-1 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
2
 * Copyright (c) 2004, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 36-41 Link Here
36
	public static final int K_CLASS = 1;
36
	public static final int K_CLASS = 1;
37
	public static final int K_INTERFACE = 2;
37
	public static final int K_INTERFACE = 2;
38
	public static final int K_EXCEPTION = 3;
38
	public static final int K_EXCEPTION = 3;
39
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
40
	public static final int K_INTERFACE_EXCLUDING_ANNOTATIONS = 4;
39
41
40
	private int kind = K_TYPE;
42
	private int kind = K_TYPE;
41
	public char[] completionIdentifier;
43
	public char[] completionIdentifier;
Lines 75-80 Link Here
75
	public boolean isSuperType(){
77
	public boolean isSuperType(){
76
		return this.kind == K_CLASS || this.kind == K_INTERFACE;
78
		return this.kind == K_CLASS || this.kind == K_INTERFACE;
77
	}
79
	}
80
	
81
	public boolean isInterfaceExcludingAnnotations(){
82
		return this.kind == K_INTERFACE_EXCLUDING_ANNOTATIONS;
83
	}
78
84
79
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
85
	public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
80
		super.resolveType(scope, checkBounds);
86
		super.resolveType(scope, checkBounds);
Lines 92-97 Link Here
92
				output.append("<CompleteOnClass:");//$NON-NLS-1$
98
				output.append("<CompleteOnClass:");//$NON-NLS-1$
93
				break;
99
				break;
94
			case K_INTERFACE :
100
			case K_INTERFACE :
101
			case K_INTERFACE_EXCLUDING_ANNOTATIONS:
95
				output.append("<CompleteOnInterface:");//$NON-NLS-1$
102
				output.append("<CompleteOnInterface:");//$NON-NLS-1$
96
				break;
103
				break;
97
			case K_EXCEPTION :
104
			case K_EXCEPTION :
Lines 132-135 Link Here
132
		output.append('.').append(this.completionIdentifier).append('>');
139
		output.append('.').append(this.completionIdentifier).append('>');
133
		return output;
140
		return output;
134
	}
141
	}
142
	
143
	public void setKind(int kind) {
144
		this.kind = kind;
145
	}
135
}
146
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnQualifiedTypeReference.java (-1 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 32-37 Link Here
32
	public static final int K_CLASS = 1;
32
	public static final int K_CLASS = 1;
33
	public static final int K_INTERFACE = 2;
33
	public static final int K_INTERFACE = 2;
34
	public static final int K_EXCEPTION = 3;
34
	public static final int K_EXCEPTION = 3;
35
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
36
	public static final int K_INTERFACE_EXCLUDING_ANNOTATIONS = 4;
35
37
36
	private int kind = K_TYPE;
38
	private int kind = K_TYPE;
37
	public char[] completionIdentifier;
39
	public char[] completionIdentifier;
Lines 85-90 Link Here
85
public boolean isSuperType(){
87
public boolean isSuperType(){
86
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
88
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
87
}
89
}
90
91
public boolean isInterfaceExcludingAnnotations(){
92
	return this.kind == K_INTERFACE_EXCLUDING_ANNOTATIONS;
93
}
88
public void setKind(int kind) {
94
public void setKind(int kind) {
89
	this.kind = kind;
95
	this.kind = kind;
90
}
96
}
Lines 94-99 Link Here
94
			output.append("<CompleteOnClass:");//$NON-NLS-1$
100
			output.append("<CompleteOnClass:");//$NON-NLS-1$
95
			break;
101
			break;
96
		case K_INTERFACE :
102
		case K_INTERFACE :
103
		case K_INTERFACE_EXCLUDING_ANNOTATIONS:
97
			output.append("<CompleteOnInterface:");//$NON-NLS-1$
104
			output.append("<CompleteOnInterface:");//$NON-NLS-1$
98
			break;
105
			break;
99
		case K_EXCEPTION :
106
		case K_EXCEPTION :
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java (-1 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 32-37 Link Here
32
public static final int K_CLASS = 1;
32
public static final int K_CLASS = 1;
33
public static final int K_INTERFACE = 2;
33
public static final int K_INTERFACE = 2;
34
public static final int K_EXCEPTION = 3;
34
public static final int K_EXCEPTION = 3;
35
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
36
public static final int K_INTERFACE_EXCLUDING_ANNOTATIONS = 4;
35
37
36
private int kind = K_TYPE;
38
private int kind = K_TYPE;
37
public boolean isCompletionNode;
39
public boolean isCompletionNode;
Lines 77-88 Link Here
77
public boolean isSuperType(){
79
public boolean isSuperType(){
78
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
80
	return this.kind == K_CLASS || this.kind == K_INTERFACE;
79
}
81
}
82
public boolean isInterfaceExcludingAnnotations(){
83
	return this.kind == K_INTERFACE_EXCLUDING_ANNOTATIONS;
84
}
80
public StringBuffer printExpression(int indent, StringBuffer output){
85
public StringBuffer printExpression(int indent, StringBuffer output){
81
	switch (this.kind) {
86
	switch (this.kind) {
82
		case K_CLASS :
87
		case K_CLASS :
83
			output.append("<CompleteOnClass:");//$NON-NLS-1$
88
			output.append("<CompleteOnClass:");//$NON-NLS-1$
84
			break;
89
			break;
85
		case K_INTERFACE :
90
		case K_INTERFACE :
91
		case K_INTERFACE_EXCLUDING_ANNOTATIONS:
86
			output.append("<CompleteOnInterface:");//$NON-NLS-1$
92
			output.append("<CompleteOnInterface:");//$NON-NLS-1$
87
			break;
93
			break;
88
		case K_EXCEPTION :
94
		case K_EXCEPTION :
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (+23 lines)
Lines 2157-2162 Link Here
2157
		}
2157
		}
2158
	}
2158
	}
2159
}
2159
}
2160
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
2161
protected void consumeClassHeaderImplements() {
2162
	super.consumeClassHeaderImplements();
2163
	// Make sure that no annotations are proposed after implements keyword
2164
	if (this.assistNode != null) {
2165
		if (this.assistNode instanceof CompletionOnSingleTypeReference) {
2166
			CompletionOnSingleTypeReference completionNode = (CompletionOnSingleTypeReference) this.assistNode;
2167
			if (completionNode.isInterface()) {
2168
				completionNode.setKind(CompletionOnSingleTypeReference.K_INTERFACE_EXCLUDING_ANNOTATIONS);
2169
			}
2170
		} else if (this.assistNode instanceof CompletionOnQualifiedTypeReference) {
2171
			CompletionOnQualifiedTypeReference completionNode = (CompletionOnQualifiedTypeReference) this.assistNode;
2172
			if (completionNode.isInterface()) {
2173
				completionNode.setKind(CompletionOnQualifiedTypeReference.K_INTERFACE_EXCLUDING_ANNOTATIONS);
2174
			}
2175
		} else if (this.assistNode instanceof CompletionOnParameterizedQualifiedTypeReference) {
2176
			CompletionOnParameterizedQualifiedTypeReference completionNode = (CompletionOnParameterizedQualifiedTypeReference) this.assistNode;
2177
			if (completionNode.isInterface()) {
2178
				completionNode.setKind(CompletionOnParameterizedQualifiedTypeReference.K_INTERFACE_EXCLUDING_ANNOTATIONS);
2179
			}
2180
		}
2181
	}
2182
}
2160
protected void consumeClassTypeElt() {
2183
protected void consumeClassTypeElt() {
2161
	pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION);
2184
	pushOnElementStack(K_NEXT_TYPEREF_IS_EXCEPTION);
2162
	super.consumeClassTypeElt();
2185
	super.consumeClassTypeElt();
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java (-1 / +56 lines)
Lines 6602-6608 Link Here
6602
	            result.context);
6602
	            result.context);
6603
6603
6604
	    assertResults(
6604
	    assertResults(
6605
	            "ZZType.ZZAnnotation[TYPE_REF]{p.ZZType.ZZAnnotation, p, Lp.ZZType$ZZAnnotation;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_INTERFACE + R_NON_RESTRICTED) + "}\n" +
6606
				"ZZType.ZZInterface[TYPE_REF]{p.ZZType.ZZInterface, p, Lp.ZZType$ZZInterface;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_INTERFACE + R_NON_RESTRICTED) + "}",
6605
				"ZZType.ZZInterface[TYPE_REF]{p.ZZType.ZZInterface, p, Lp.ZZType$ZZInterface;, null, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_INTERFACE + R_NON_RESTRICTED) + "}",
6607
	            result.proposals);
6606
	            result.proposals);
6608
	} finally {
6607
	} finally {
Lines 13815-13818 Link Here
13815
			"\ud842\udf9fabc[LABEL_REF]{\ud842\udf9fabc, null, null, \ud842\udf9fabc, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
13814
			"\ud842\udf9fabc[LABEL_REF]{\ud842\udf9fabc, null, null, \ud842\udf9fabc, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
13816
			requestor.getResults());
13815
			requestor.getResults());
13817
}
13816
}
13817
13818
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
13819
// Annotation types are not proposed after 'implements' in a Single type ref
13820
public void testBug310423a() throws JavaModelException {
13821
	this.workingCopies = new ICompilationUnit[1];
13822
	this.workingCopies[0] = getWorkingCopy(
13823
		"/Completion/src/label/Test.java",
13824
		"import java.lang.annotation.Annotation;\n" +
13825
		"interface In {}\n" +
13826
		"interface Inn {\n" +
13827
		"	interface Inn2 {}\n" +
13828
		"	@interface IAnnot {}\n" +
13829
		"}\n" +
13830
		"@interface InnAnnot {}\n"+
13831
		"public class Test implements {\n" +
13832
		"}\n");
13833
13834
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13835
	String str = this.workingCopies[0].getSource();
13836
	String completeBehind = "implements";
13837
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() + 1;
13838
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
13839
13840
	assertResults(
13841
			"Inn.Inn2[TYPE_REF]{label.Inn.Inn2, label, Llabel.Inn$Inn2;, null, null, 44}\n" +
13842
			"In[TYPE_REF]{In, label, Llabel.In;, null, null, 47}\n" +
13843
			"Inn[TYPE_REF]{Inn, label, Llabel.Inn;, null, null, 47}",
13844
			requestor.getResults());
13845
}
13846
13847
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310423
13848
// Annotation types are not proposed after 'implements' in a Qualified type ref
13849
public void testBug310423b() throws JavaModelException {
13850
	this.workingCopies = new ICompilationUnit[1];
13851
	this.workingCopies[0] = getWorkingCopy(
13852
		"/Completion/src/label/Test.java",
13853
		"interface In{}\n" +
13854
		"interface Inn{\n" +
13855
		"	interface Inn2{}\n" +
13856
		"	interface Inn3{}\n" +
13857
		"	@interface IAnnot {}\n" +
13858
		"}"+
13859
		"public class Test implements Inn. {\n" +
13860
		"}\n");
13861
13862
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13863
	String str = this.workingCopies[0].getSource();
13864
	String completeBehind = "Inn.";
13865
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() + 1;
13866
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
13867
13868
	assertResults(
13869
			"Inn.Inn2[TYPE_REF]{Inn2, label, Llabel.Inn$Inn2;, null, null, 44}\n" +
13870
			"Inn.Inn3[TYPE_REF]{Inn3, label, Llabel.Inn$Inn3;, null, null, 44}",
13871
			requestor.getResults());
13872
}
13818
}
13873
}

Return to bug 310423