Lines 173-188
Link Here
|
173 |
if(this.proposalsPtr < 0) return ""; |
173 |
if(this.proposalsPtr < 0) return ""; |
174 |
Arrays.sort(this.proposals, new Comparator() { |
174 |
Arrays.sort(this.proposals, new Comparator() { |
175 |
public int compare(Object o1, Object o2) { |
175 |
public int compare(Object o1, Object o2) { |
176 |
if (o1 instanceof CompletionProposal && o2 instanceof CompletionProposal) { |
176 |
if (o1 == null) { |
177 |
CompletionProposal p1 = (CompletionProposal) o1; |
177 |
if (o2 == null) { |
178 |
CompletionProposal p2 = (CompletionProposal) o2; |
178 |
return 0; |
179 |
int relDif = p2.getRelevance() - p1.getRelevance(); |
179 |
} else { |
180 |
if(relDif != 0) return relDif; |
180 |
return 1; |
181 |
String name1 = getElementName(p1); |
181 |
} |
182 |
String name2 = getElementName(p2); |
182 |
} else if (o2 == null) { |
183 |
return name1.compareTo(name2); |
183 |
return -1; |
184 |
} |
184 |
} |
185 |
return -1; |
185 |
CompletionProposal p1 = (CompletionProposal) o1; |
|
|
186 |
CompletionProposal p2 = (CompletionProposal) o2; |
187 |
int relDif = p2.getRelevance() - p1.getRelevance(); |
188 |
if(relDif != 0) return relDif; |
189 |
String name1 = getElementName(p1); |
190 |
String name2 = getElementName(p2); |
191 |
return name1.compareTo(name2); |
186 |
} |
192 |
} |
187 |
}); |
193 |
}); |
188 |
return getResultsWithoutSorting(); |
194 |
return getResultsWithoutSorting(); |