From 13ea4a47fd30debd4b9da74cc6a4e7c19aea8f30 Mon Sep 17 00:00:00 2001 From: Nikolay Kuznetsov Date: Wed, 20 Dec 2017 14:30:13 +0100 Subject: [PATCH] Properly handle usage views with mixed usage types (cherry picked from commit d6dbcab from Rider fork) --- .../usageView/src/com/intellij/usages/impl/UsageViewImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java index c8b1a5177bdc..bb2b6370aafc 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java @@ -117,7 +117,7 @@ public class UsageViewImpl implements UsageView { if (o1 == o2) return 0; if (o1 == NULL_NODE) return -1; if (o2 == NULL_NODE) return 1; - if (o1 instanceof Comparable && o2 instanceof Comparable) { + if (o1 instanceof Comparable && o2 instanceof Comparable && o1.getClass() == o2.getClass()) { //noinspection unchecked final int selfcompared = ((Comparable)o1).compareTo(o2); if (selfcompared != 0) return selfcompared;