mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
make sort more stable: EA-50594 - IAE: UsageViewImpl.rulesChanged
This commit is contained in:
@@ -108,7 +108,9 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
public static final Comparator<Usage> USAGE_COMPARATOR = new Comparator<Usage>() {
|
||||
@Override
|
||||
public int compare(final Usage o1, final Usage o2) {
|
||||
if (o1 == NULL_NODE || o2 == NULL_NODE) return -1;
|
||||
if (o1 == o2) return 0;
|
||||
if (o1 == NULL_NODE) return -1;
|
||||
if (o2 == NULL_NODE) return 1;
|
||||
if (o1 instanceof Comparable && o2 instanceof Comparable) {
|
||||
final int selfcompared = ((Comparable<Usage>)o1).compareTo(o2);
|
||||
if (selfcompared != 0) return selfcompared;
|
||||
@@ -127,7 +129,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
return o1.toString().compareTo(o2.toString());
|
||||
}
|
||||
};
|
||||
@NonNls private static final String HELP_ID = "ideaInterface.find";
|
||||
|
||||
Reference in New Issue
Block a user