use identity map when inspecting lookup item weights (EA-90364 - INRE: FileBasedIndex...
authorpeter <peter@jetbrains.com>
Wed, 9 Nov 2016 16:18:39 +0000 (17:18 +0100)
committerpeter <peter@jetbrains.com>
Fri, 11 Nov 2016 12:21:58 +0000 (13:21 +0100)
platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionLookupArranger.java

index f66b95fb9865ba0a7cda7f5679bb151e63eb2f47..7abcd019f0782c83f50375cec947fdf6a6b068b3 100644 (file)
@@ -41,6 +41,7 @@ import com.intellij.util.Alarm;
 import com.intellij.util.ProcessingContext;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.MultiMap;
+import com.intellij.util.containers.hash.EqualityPolicy;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -106,7 +107,8 @@ public class CompletionLookupArranger extends LookupArranger {
   @Override
   public Map<LookupElement, List<Pair<String, Object>>> getRelevanceObjects(@NotNull Iterable<LookupElement> items,
                                                                                boolean hideSingleValued) {
-    final LinkedHashMap<LookupElement, List<Pair<String, Object>>> map = ContainerUtil.newLinkedHashMap();
+    //noinspection unchecked
+    final Map<LookupElement, List<Pair<String, Object>>> map = new com.intellij.util.containers.hash.LinkedHashMap(EqualityPolicy.IDENTITY);
     final MultiMap<CompletionSorterImpl, LookupElement> inputBySorter = groupItemsBySorter(items);
     int sorterNumber = 0;
     for (CompletionSorterImpl sorter : inputBySorter.keySet()) {