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 == o2) |
177 |
CompletionProposal p1 = (CompletionProposal) o1; |
177 |
return 0; |
178 |
CompletionProposal p2 = (CompletionProposal) o2; |
178 |
if (o1 == null) |
179 |
int relDif = p2.getRelevance() - p1.getRelevance(); |
179 |
return 1; |
180 |
if(relDif != 0) return relDif; |
180 |
if (o2 == null) |
181 |
String name1 = getElementName(p1); |
181 |
return -1; |
182 |
String name2 = getElementName(p2); |
182 |
CompletionProposal p1 = (CompletionProposal) o1; |
183 |
return name1.compareTo(name2); |
183 |
CompletionProposal p2 = (CompletionProposal) o2; |
184 |
} |
184 |
int relDif = p2.getRelevance() - p1.getRelevance(); |
185 |
return -1; |
185 |
if(relDif != 0) return relDif; |
|
|
186 |
String name1 = getElementName(p1); |
187 |
String name2 = getElementName(p2); |
188 |
return name1.compareTo(name2); |
186 |
} |
189 |
} |
187 |
}); |
190 |
}); |
188 |
return getResultsWithoutSorting(); |
191 |
return getResultsWithoutSorting(); |