Lines 46-51
Link Here
|
46 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
46 |
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; |
47 |
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; |
47 |
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; |
48 |
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; |
48 |
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; |
|
|
49 |
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; |
49 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
50 |
import org.eclipse.jdt.internal.compiler.util.SuffixConstants; |
50 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; |
51 |
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; |
51 |
import org.eclipse.jdt.internal.compiler.util.ObjectVector; |
52 |
import org.eclipse.jdt.internal.compiler.util.ObjectVector; |
Lines 71-79
Link Here
|
71 |
public class CompletionProblemFactory extends DefaultProblemFactory { |
72 |
public class CompletionProblemFactory extends DefaultProblemFactory { |
72 |
private int lastErrorStart; |
73 |
private int lastErrorStart; |
73 |
|
74 |
|
74 |
public boolean checkProblems = false; |
75 |
private boolean checkProblems = false; |
75 |
public boolean hasProblems = false; |
76 |
public boolean hasForbiddenProblems = false; |
76 |
|
77 |
public boolean hasAllowedProblems = false; |
|
|
78 |
|
77 |
public CompletionProblemFactory(Locale loc) { |
79 |
public CompletionProblemFactory(Locale loc) { |
78 |
super(loc); |
80 |
super(loc); |
79 |
} |
81 |
} |
Lines 109-134
Link Here
|
109 |
CompletionEngine.this.problem = pb; |
111 |
CompletionEngine.this.problem = pb; |
110 |
this.lastErrorStart = start; |
112 |
this.lastErrorStart = start; |
111 |
} |
113 |
} |
112 |
if (this.checkProblems && !this.hasProblems) { |
114 |
if (this.checkProblems && !this.hasForbiddenProblems) { |
113 |
if (id == IProblem.UsingDeprecatedType) { |
115 |
switch (id) { |
114 |
this.hasProblems = |
116 |
case IProblem.UsingDeprecatedType: |
115 |
CompletionEngine.this.options.checkDeprecation; |
117 |
this.hasForbiddenProblems = |
116 |
} else if (id == IProblem.NotVisibleType) { |
118 |
CompletionEngine.this.options.checkDeprecation; |
117 |
this.hasProblems = |
119 |
break; |
118 |
CompletionEngine.this.options.checkVisibility; |
120 |
case IProblem.NotVisibleType: |
119 |
} else if (id == IProblem.ForbiddenReference) { |
121 |
this.hasForbiddenProblems = |
120 |
this.hasProblems = |
122 |
CompletionEngine.this.options.checkVisibility; |
121 |
CompletionEngine.this.options.checkForbiddenReference; |
123 |
break; |
122 |
} else if (id == IProblem.DiscouragedReference) { |
124 |
case IProblem.ForbiddenReference: |
123 |
this.hasProblems = |
125 |
this.hasForbiddenProblems = |
124 |
CompletionEngine.this.options.checkDiscouragedReference; |
126 |
CompletionEngine.this.options.checkForbiddenReference; |
125 |
} else { |
127 |
break; |
126 |
this.hasProblems = true; |
128 |
case IProblem.DiscouragedReference: |
|
|
129 |
this.hasForbiddenProblems = |
130 |
CompletionEngine.this.options.checkDiscouragedReference; |
131 |
break; |
132 |
default: |
133 |
if ((severity & ProblemSeverities.Optional) != 0) { |
134 |
this.hasAllowedProblems = true; |
135 |
} else { |
136 |
this.hasForbiddenProblems = true; |
137 |
} |
138 |
|
139 |
break; |
127 |
} |
140 |
} |
128 |
} |
141 |
} |
129 |
|
142 |
|
130 |
return pb; |
143 |
return pb; |
131 |
} |
144 |
} |
|
|
145 |
|
146 |
public void startCheckingProblems() { |
147 |
this.checkProblems = true; |
148 |
this.hasForbiddenProblems = false; |
149 |
this.hasAllowedProblems = false; |
150 |
} |
151 |
|
152 |
public void stopCheckingProblems() { |
153 |
this.checkProblems = false; |
154 |
} |
132 |
} |
155 |
} |
133 |
|
156 |
|
134 |
private class AcceptedType { |
157 |
private class AcceptedType { |
Lines 805-811
Link Here
|
805 |
SourceTypeBinding enclosingType = scope.enclosingSourceType(); |
828 |
SourceTypeBinding enclosingType = scope.enclosingSourceType(); |
806 |
if (!enclosingType.isAnnotationType()) { |
829 |
if (!enclosingType.isAnnotationType()) { |
807 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_DECLARATION)) { |
830 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_DECLARATION)) { |
808 |
findMethods(this.completionToken,null,null,enclosingType,scope,new ObjectVector(),false,false,true,null,null,false,false,true,null, null, null); |
831 |
findMethods(this.completionToken,null,null,enclosingType,scope,new ObjectVector(),false,false,true,null,null,false,false,true,null, null, null, false); |
809 |
} |
832 |
} |
810 |
if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) { |
833 |
if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) { |
811 |
proposeNewMethod(this.completionToken, enclosingType); |
834 |
proposeNewMethod(this.completionToken, enclosingType); |
Lines 827-833
Link Here
|
827 |
SourceTypeBinding enclosingType = scope.enclosingSourceType(); |
850 |
SourceTypeBinding enclosingType = scope.enclosingSourceType(); |
828 |
if (!enclosingType.isAnnotationType()) { |
851 |
if (!enclosingType.isAnnotationType()) { |
829 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_DECLARATION)) { |
852 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_DECLARATION)) { |
830 |
findMethods(this.completionToken,null,null,scope.enclosingSourceType(),scope,new ObjectVector(),false,false,true,null,null,false,false,true,null, null, null); |
853 |
findMethods(this.completionToken,null,null,scope.enclosingSourceType(),scope,new ObjectVector(),false,false,true,null,null,false,false,true,null, null, null, false); |
831 |
} |
854 |
} |
832 |
if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) { |
855 |
if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) { |
833 |
proposeNewMethod(this.completionToken, scope.enclosingSourceType()); |
856 |
proposeNewMethod(this.completionToken, scope.enclosingSourceType()); |
Lines 940-946
Link Here
|
940 |
setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); |
963 |
setSourceRange((int) (completionPosition >>> 32), (int) completionPosition); |
941 |
TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type; |
964 |
TypeBinding receiverType = ((VariableBinding) qualifiedBinding).type; |
942 |
if (receiverType != null) { |
965 |
if (receiverType != null) { |
943 |
findFieldsAndMethods(this.completionToken, receiverType.capture(scope, ref.sourceEnd), scope, ref, scope,false,false, null, null, null); |
966 |
findFieldsAndMethods(this.completionToken, receiverType.capture(scope, ref.sourceEnd), scope, ref, scope,false,false, null, null, null, false); |
944 |
} else if (this.assistNodeInJavadoc == 0 && |
967 |
} else if (this.assistNodeInJavadoc == 0 && |
945 |
(this.requestor.isAllowingRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF) || |
968 |
(this.requestor.isAllowingRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF) || |
946 |
this.requestor.isAllowingRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.TYPE_REF))) { |
969 |
this.requestor.isAllowingRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.TYPE_REF))) { |
Lines 1029-1035
Link Here
|
1029 |
false, |
1052 |
false, |
1030 |
null, |
1053 |
null, |
1031 |
null, |
1054 |
null, |
1032 |
null); |
1055 |
null, |
|
|
1056 |
false); |
1033 |
} |
1057 |
} |
1034 |
|
1058 |
|
1035 |
if (!isInsideAnnotationAttribute && !this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { |
1059 |
if (!isInsideAnnotationAttribute && !this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { |
Lines 1050-1056
Link Here
|
1050 |
false, |
1074 |
false, |
1051 |
null, |
1075 |
null, |
1052 |
null, |
1076 |
null, |
1053 |
null); |
1077 |
null, |
|
|
1078 |
false); |
1054 |
} |
1079 |
} |
1055 |
|
1080 |
|
1056 |
} else if (qualifiedBinding instanceof PackageBinding) { |
1081 |
} else if (qualifiedBinding instanceof PackageBinding) { |
Lines 1134-1140
Link Here
|
1134 |
access.receiver instanceof SuperReference, |
1159 |
access.receiver instanceof SuperReference, |
1135 |
null, |
1160 |
null, |
1136 |
null, |
1161 |
null, |
1137 |
null); |
1162 |
null, |
|
|
1163 |
false); |
1138 |
} |
1164 |
} |
1139 |
|
1165 |
|
1140 |
} else if (astNode instanceof CompletionOnMessageSend) { |
1166 |
} else if (astNode instanceof CompletionOnMessageSend) { |
Lines 1165-1171
Link Here
|
1165 |
false, |
1191 |
false, |
1166 |
null, |
1192 |
null, |
1167 |
null, |
1193 |
null, |
1168 |
null); |
1194 |
null, |
|
|
1195 |
false); |
1169 |
} |
1196 |
} |
1170 |
} else if (astNode instanceof CompletionOnExplicitConstructorCall) { |
1197 |
} else if (astNode instanceof CompletionOnExplicitConstructorCall) { |
1171 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { |
1198 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF)) { |
Lines 1403-1409
Link Here
|
1403 |
false, |
1430 |
false, |
1404 |
null, |
1431 |
null, |
1405 |
null, |
1432 |
null, |
1406 |
null); |
1433 |
null, |
|
|
1434 |
false); |
1407 |
} |
1435 |
} |
1408 |
} |
1436 |
} |
1409 |
} |
1437 |
} |
Lines 1479-1485
Link Here
|
1479 |
true, |
1507 |
true, |
1480 |
null, |
1508 |
null, |
1481 |
null, |
1509 |
null, |
1482 |
null); |
1510 |
null, |
|
|
1511 |
false); |
1483 |
} |
1512 |
} |
1484 |
|
1513 |
|
1485 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF) |
1514 |
if (!this.requestor.isIgnored(CompletionProposal.METHOD_REF) |
Lines 1500-1506
Link Here
|
1500 |
true, |
1529 |
true, |
1501 |
null, |
1530 |
null, |
1502 |
null, |
1531 |
null, |
1503 |
null); |
1532 |
null, |
|
|
1533 |
false); |
1504 |
if (fieldRef.receiverType instanceof ReferenceBinding) { |
1534 |
if (fieldRef.receiverType instanceof ReferenceBinding) { |
1505 |
ReferenceBinding refBinding = (ReferenceBinding)fieldRef.receiverType; |
1535 |
ReferenceBinding refBinding = (ReferenceBinding)fieldRef.receiverType; |
1506 |
if (this.completionToken == null |
1536 |
if (this.completionToken == null |
Lines 1551-1557
Link Here
|
1551 |
true, |
1581 |
true, |
1552 |
null, |
1582 |
null, |
1553 |
null, |
1583 |
null, |
1554 |
null); |
1584 |
null, |
|
|
1585 |
false); |
1555 |
} |
1586 |
} |
1556 |
} else if (astNode instanceof CompletionOnJavadocAllocationExpression) { |
1587 |
} else if (astNode instanceof CompletionOnJavadocAllocationExpression) { |
1557 |
// setSourceRange(astNode.sourceStart, astNode.sourceEnd, false); |
1588 |
// setSourceRange(astNode.sourceStart, astNode.sourceEnd, false); |
Lines 2547-2553
Link Here
|
2547 |
boolean canBePrefixed, |
2578 |
boolean canBePrefixed, |
2548 |
Binding[] missingElements, |
2579 |
Binding[] missingElements, |
2549 |
int[] missingElementsStarts, |
2580 |
int[] missingElementsStarts, |
2550 |
int[] missingElementsEnds) { |
2581 |
int[] missingElementsEnds, |
|
|
2582 |
boolean missingElementsHaveProblems) { |
2551 |
|
2583 |
|
2552 |
ObjectVector newFieldsFound = new ObjectVector(); |
2584 |
ObjectVector newFieldsFound = new ObjectVector(); |
2553 |
// Inherited fields which are hidden by subclasses are filtered out |
2585 |
// Inherited fields which are hidden by subclasses are filtered out |
Lines 2658-2663
Link Here
|
2658 |
if (onlyStaticFields && this.insideQualifiedReference) { |
2690 |
if (onlyStaticFields && this.insideQualifiedReference) { |
2659 |
relevance += computeRelevanceForInheritance(receiverType, field.declaringClass); |
2691 |
relevance += computeRelevanceForInheritance(receiverType, field.declaringClass); |
2660 |
} |
2692 |
} |
|
|
2693 |
if (missingElements != null) { |
2694 |
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems); |
2695 |
} |
2661 |
|
2696 |
|
2662 |
this.noProposal = false; |
2697 |
this.noProposal = false; |
2663 |
// Standard proposal |
2698 |
// Standard proposal |
Lines 2751-2757
Link Here
|
2751 |
boolean canBePrefixed, |
2786 |
boolean canBePrefixed, |
2752 |
Binding[] missingElements, |
2787 |
Binding[] missingElements, |
2753 |
int[] missingElementsStarts, |
2788 |
int[] missingElementsStarts, |
2754 |
int[] missingElementsEnds) { |
2789 |
int[] missingElementsEnds, |
|
|
2790 |
boolean missingElementsHaveProblems) { |
2755 |
|
2791 |
|
2756 |
boolean notInJavadoc = this.assistNodeInJavadoc == 0; |
2792 |
boolean notInJavadoc = this.assistNodeInJavadoc == 0; |
2757 |
if (fieldName == null && notInJavadoc) |
2793 |
if (fieldName == null && notInJavadoc) |
Lines 2795-2801
Link Here
|
2795 |
canBePrefixed, |
2831 |
canBePrefixed, |
2796 |
missingElements, |
2832 |
missingElements, |
2797 |
missingElementsStarts, |
2833 |
missingElementsStarts, |
2798 |
missingElementsEnds); |
2834 |
missingElementsEnds, |
|
|
2835 |
missingElementsHaveProblems); |
2799 |
} |
2836 |
} |
2800 |
currentType = currentType.superclass(); |
2837 |
currentType = currentType.superclass(); |
2801 |
} while (notInJavadoc && currentType != null); |
2838 |
} while (notInJavadoc && currentType != null); |
Lines 2819-2825
Link Here
|
2819 |
canBePrefixed, |
2856 |
canBePrefixed, |
2820 |
missingElements, |
2857 |
missingElements, |
2821 |
missingElementsStarts, |
2858 |
missingElementsStarts, |
2822 |
missingElementsEnds); |
2859 |
missingElementsEnds, |
|
|
2860 |
missingElementsHaveProblems); |
2823 |
} |
2861 |
} |
2824 |
|
2862 |
|
2825 |
ReferenceBinding[] itsInterfaces = anInterface.superInterfaces(); |
2863 |
ReferenceBinding[] itsInterfaces = anInterface.superInterfaces(); |
Lines 2848-2854
Link Here
|
2848 |
boolean superCall, |
2886 |
boolean superCall, |
2849 |
Binding[] missingElements, |
2887 |
Binding[] missingElements, |
2850 |
int[] missingElementsStarts, |
2888 |
int[] missingElementsStarts, |
2851 |
int[] missingElementsEnds) { |
2889 |
int[] missingElementsEnds, |
|
|
2890 |
boolean missingElementsHaveProblems) { |
2852 |
|
2891 |
|
2853 |
if (token == null) |
2892 |
if (token == null) |
2854 |
return; |
2893 |
return; |
Lines 2872-2878
Link Here
|
2872 |
relevance += computeRelevanceForCaseMatching(token,lengthField); |
2911 |
relevance += computeRelevanceForCaseMatching(token,lengthField); |
2873 |
relevance += computeRelevanceForExpectingType(TypeBinding.INT); |
2912 |
relevance += computeRelevanceForExpectingType(TypeBinding.INT); |
2874 |
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for length field |
2913 |
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for length field |
2875 |
|
2914 |
if (missingElements != null) { |
|
|
2915 |
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems); |
2916 |
} |
2876 |
this.noProposal = false; |
2917 |
this.noProposal = false; |
2877 |
if(!isIgnored(CompletionProposal.FIELD_REF, missingElements != null)) { |
2918 |
if(!isIgnored(CompletionProposal.FIELD_REF, missingElements != null)) { |
2878 |
CompletionProposal proposal = this.createProposal(CompletionProposal.FIELD_REF, this.actualCompletionPosition); |
2919 |
CompletionProposal proposal = this.createProposal(CompletionProposal.FIELD_REF, this.actualCompletionPosition); |
Lines 2918-2924
Link Here
|
2918 |
relevance += computeRelevanceForStatic(false, false); |
2959 |
relevance += computeRelevanceForStatic(false, false); |
2919 |
relevance += computeRelevanceForQualification(false); |
2960 |
relevance += computeRelevanceForQualification(false); |
2920 |
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for clone() method |
2961 |
relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for clone() method |
2921 |
|
2962 |
if (missingElements != null) { |
|
|
2963 |
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems); |
2964 |
} |
2922 |
char[] completion; |
2965 |
char[] completion; |
2923 |
if (this.source != null |
2966 |
if (this.source != null |
2924 |
&& this.source.length > this.endPosition |
2967 |
&& this.source.length > this.endPosition |
Lines 2986-2992
Link Here
|
2986 |
false, |
3029 |
false, |
2987 |
missingElements, |
3030 |
missingElements, |
2988 |
missingElementsStarts, |
3031 |
missingElementsStarts, |
2989 |
missingElementsEnds); |
3032 |
missingElementsEnds, |
|
|
3033 |
missingElementsHaveProblems); |
2990 |
} |
3034 |
} |
2991 |
|
3035 |
|
2992 |
if(proposeMethod) { |
3036 |
if(proposeMethod) { |
Lines 3007-3013
Link Here
|
3007 |
false, |
3051 |
false, |
3008 |
missingElements, |
3052 |
missingElements, |
3009 |
missingElementsStarts, |
3053 |
missingElementsStarts, |
3010 |
missingElementsEnds); |
3054 |
missingElementsEnds, |
|
|
3055 |
missingElementsHaveProblems); |
3011 |
} |
3056 |
} |
3012 |
} |
3057 |
} |
3013 |
|
3058 |
|
Lines 3158-3164
Link Here
|
3158 |
TypeBinding guessedType, |
3203 |
TypeBinding guessedType, |
3159 |
Binding[] missingElements, |
3204 |
Binding[] missingElements, |
3160 |
int[] missingElementsStarts, |
3205 |
int[] missingElementsStarts, |
3161 |
int[] missingElementsEnds) { |
3206 |
int[] missingElementsEnds, |
|
|
3207 |
boolean hasProblems) { |
3162 |
findFieldsAndMethods( |
3208 |
findFieldsAndMethods( |
3163 |
CompletionEngine.this.completionToken, |
3209 |
CompletionEngine.this.completionToken, |
3164 |
guessedType, |
3210 |
guessedType, |
Lines 3169-3175
Link Here
|
3169 |
false, |
3215 |
false, |
3170 |
missingElements, |
3216 |
missingElements, |
3171 |
missingElementsStarts, |
3217 |
missingElementsStarts, |
3172 |
missingElementsEnds); |
3218 |
missingElementsEnds, |
|
|
3219 |
hasProblems); |
3173 |
|
3220 |
|
3174 |
} |
3221 |
} |
3175 |
}; |
3222 |
}; |
Lines 4002-4008
Link Here
|
4002 |
boolean canBePrefixed, |
4049 |
boolean canBePrefixed, |
4003 |
Binding[] missingElements, |
4050 |
Binding[] missingElements, |
4004 |
int[] missingElementssStarts, |
4051 |
int[] missingElementssStarts, |
4005 |
int[] missingElementsEnds) { |
4052 |
int[] missingElementsEnds, |
|
|
4053 |
boolean missingElementsHaveProblems) { |
4006 |
|
4054 |
|
4007 |
if (selector == null) |
4055 |
if (selector == null) |
4008 |
return; |
4056 |
return; |
Lines 4041-4047
Link Here
|
4041 |
canBePrefixed, |
4089 |
canBePrefixed, |
4042 |
missingElements, |
4090 |
missingElements, |
4043 |
missingElementssStarts, |
4091 |
missingElementssStarts, |
4044 |
missingElementsEnds); |
4092 |
missingElementsEnds, |
|
|
4093 |
missingElementsHaveProblems); |
4045 |
} |
4094 |
} |
4046 |
} |
4095 |
} |
4047 |
|
4096 |
|
Lines 4104-4110
Link Here
|
4104 |
true, |
4153 |
true, |
4105 |
null, |
4154 |
null, |
4106 |
null, |
4155 |
null, |
4107 |
null); |
4156 |
null, |
|
|
4157 |
false); |
4108 |
staticsOnly |= enclosingType.isStatic(); |
4158 |
staticsOnly |= enclosingType.isStatic(); |
4109 |
break; |
4159 |
break; |
4110 |
|
4160 |
|
Lines 4133-4139
Link Here
|
4133 |
boolean canBePrefixed, |
4183 |
boolean canBePrefixed, |
4134 |
Binding[] missingElements, |
4184 |
Binding[] missingElements, |
4135 |
int[] missingElementsStarts, |
4185 |
int[] missingElementsStarts, |
4136 |
int[] missingElementsEnds) { |
4186 |
int[] missingElementsEnds, |
|
|
4187 |
boolean missingElementsHaveProblems) { |
4137 |
|
4188 |
|
4138 |
ObjectVector newMethodsFound = new ObjectVector(); |
4189 |
ObjectVector newMethodsFound = new ObjectVector(); |
4139 |
// Inherited methods which are hidden by subclasses are filtered out |
4190 |
// Inherited methods which are hidden by subclasses are filtered out |
Lines 4339-4344
Link Here
|
4339 |
if (onlyStaticMethods && this.insideQualifiedReference) { |
4390 |
if (onlyStaticMethods && this.insideQualifiedReference) { |
4340 |
relevance += computeRelevanceForInheritance(receiverType, method.declaringClass); |
4391 |
relevance += computeRelevanceForInheritance(receiverType, method.declaringClass); |
4341 |
} |
4392 |
} |
|
|
4393 |
if (missingElements != null) { |
4394 |
relevance += computeRelevanceForMissingElements(missingElementsHaveProblems); |
4395 |
} |
4342 |
|
4396 |
|
4343 |
this.noProposal = false; |
4397 |
this.noProposal = false; |
4344 |
// Standard proposal |
4398 |
// Standard proposal |
Lines 4587-4592
Link Here
|
4587 |
} |
4641 |
} |
4588 |
return 0; |
4642 |
return 0; |
4589 |
} |
4643 |
} |
|
|
4644 |
private int computeRelevanceForMissingElements(boolean hasProblems) { |
4645 |
if (!hasProblems) { |
4646 |
return R_NO_PROBLEMS; |
4647 |
} |
4648 |
return 0; |
4649 |
} |
4590 |
private int computeRelevanceForQualification(boolean prefixRequired) { |
4650 |
private int computeRelevanceForQualification(boolean prefixRequired) { |
4591 |
if(!prefixRequired && !this.insideQualifiedReference) { |
4651 |
if(!prefixRequired && !this.insideQualifiedReference) { |
4592 |
return R_UNQUALIFIED; |
4652 |
return R_UNQUALIFIED; |
Lines 5043-5049
Link Here
|
5043 |
boolean canBePrefixed, |
5103 |
boolean canBePrefixed, |
5044 |
Binding[] missingElements, |
5104 |
Binding[] missingElements, |
5045 |
int[] missingElementsStarts, |
5105 |
int[] missingElementsStarts, |
5046 |
int[] missingElementsEnds) { |
5106 |
int[] missingElementsEnds, |
|
|
5107 |
boolean missingElementsHaveProblems) { |
5047 |
|
5108 |
|
5048 |
boolean notInJavadoc = this.assistNodeInJavadoc == 0; |
5109 |
boolean notInJavadoc = this.assistNodeInJavadoc == 0; |
5049 |
if (selector == null && notInJavadoc) { |
5110 |
if (selector == null && notInJavadoc) { |
Lines 5083-5089
Link Here
|
5083 |
canBePrefixed, |
5144 |
canBePrefixed, |
5084 |
missingElements, |
5145 |
missingElements, |
5085 |
missingElementsStarts, |
5146 |
missingElementsStarts, |
5086 |
missingElementsEnds); |
5147 |
missingElementsEnds, |
|
|
5148 |
missingElementsHaveProblems); |
5087 |
} else { |
5149 |
} else { |
5088 |
findInterfacesMethods( |
5150 |
findInterfacesMethods( |
5089 |
selector, |
5151 |
selector, |
Lines 5103-5109
Link Here
|
5103 |
canBePrefixed, |
5165 |
canBePrefixed, |
5104 |
missingElements, |
5166 |
missingElements, |
5105 |
missingElementsStarts, |
5167 |
missingElementsStarts, |
5106 |
missingElementsEnds); |
5168 |
missingElementsEnds, |
|
|
5169 |
missingElementsHaveProblems); |
5107 |
} |
5170 |
} |
5108 |
|
5171 |
|
5109 |
currentType = scope.getJavaLangObject(); |
5172 |
currentType = scope.getJavaLangObject(); |
Lines 5127-5133
Link Here
|
5127 |
canBePrefixed, |
5190 |
canBePrefixed, |
5128 |
missingElements, |
5191 |
missingElements, |
5129 |
missingElementsStarts, |
5192 |
missingElementsStarts, |
5130 |
missingElementsEnds); |
5193 |
missingElementsEnds, |
|
|
5194 |
missingElementsHaveProblems); |
5131 |
|
5195 |
|
5132 |
currentType = receiverType.superclass(); |
5196 |
currentType = receiverType.superclass(); |
5133 |
} |
5197 |
} |
Lines 5164-5170
Link Here
|
5164 |
canBePrefixed, |
5228 |
canBePrefixed, |
5165 |
missingElements, |
5229 |
missingElements, |
5166 |
missingElementsStarts, |
5230 |
missingElementsStarts, |
5167 |
missingElementsEnds); |
5231 |
missingElementsEnds, |
|
|
5232 |
missingElementsHaveProblems); |
5168 |
} |
5233 |
} |
5169 |
} |
5234 |
} |
5170 |
|
5235 |
|
Lines 5187-5193
Link Here
|
5187 |
canBePrefixed, |
5252 |
canBePrefixed, |
5188 |
missingElements, |
5253 |
missingElements, |
5189 |
missingElementsStarts, |
5254 |
missingElementsStarts, |
5190 |
missingElementsEnds); |
5255 |
missingElementsEnds, |
|
|
5256 |
missingElementsHaveProblems); |
5191 |
} else { |
5257 |
} else { |
5192 |
hasPotentialDefaultAbstractMethods = false; |
5258 |
hasPotentialDefaultAbstractMethods = false; |
5193 |
} |
5259 |
} |
Lines 6044-6050
Link Here
|
6044 |
true, |
6110 |
true, |
6045 |
null, |
6111 |
null, |
6046 |
null, |
6112 |
null, |
6047 |
null); |
6113 |
null, |
|
|
6114 |
false); |
6048 |
} |
6115 |
} |
6049 |
if(proposeMethod && !insideAnnotationAttribute) { |
6116 |
if(proposeMethod && !insideAnnotationAttribute) { |
6050 |
findMethods( |
6117 |
findMethods( |
Lines 6064-6070
Link Here
|
6064 |
true, |
6131 |
true, |
6065 |
null, |
6132 |
null, |
6066 |
null, |
6133 |
null, |
6067 |
null); |
6134 |
null, |
|
|
6135 |
false); |
6068 |
} |
6136 |
} |
6069 |
} |
6137 |
} |
6070 |
staticsOnly |= enclosingType.isStatic(); |
6138 |
staticsOnly |= enclosingType.isStatic(); |
Lines 6100-6106
Link Here
|
6100 |
false, |
6168 |
false, |
6101 |
null, |
6169 |
null, |
6102 |
null, |
6170 |
null, |
6103 |
null); |
6171 |
null, |
|
|
6172 |
false); |
6104 |
} |
6173 |
} |
6105 |
if(proposeMethod && !insideAnnotationAttribute) { |
6174 |
if(proposeMethod && !insideAnnotationAttribute) { |
6106 |
findMethods( |
6175 |
findMethods( |
Lines 6120-6126
Link Here
|
6120 |
false, |
6189 |
false, |
6121 |
null, |
6190 |
null, |
6122 |
null, |
6191 |
null, |
6123 |
null); |
6192 |
null, |
|
|
6193 |
false); |
6124 |
} |
6194 |
} |
6125 |
} |
6195 |
} |
6126 |
} else { |
6196 |
} else { |
Lines 6140-6146
Link Here
|
6140 |
false, |
6210 |
false, |
6141 |
null, |
6211 |
null, |
6142 |
null, |
6212 |
null, |
6143 |
null); |
6213 |
null, |
|
|
6214 |
false); |
6144 |
} |
6215 |
} |
6145 |
} else if ((binding.kind() & Binding.METHOD) != 0) { |
6216 |
} else if ((binding.kind() & Binding.METHOD) != 0) { |
6146 |
if(proposeMethod && !insideAnnotationAttribute) { |
6217 |
if(proposeMethod && !insideAnnotationAttribute) { |