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) { |