EA-20144
authorAlexey Kudravtsev <cdr@intellij.com>
Thu, 19 Aug 2010 14:28:35 +0000 (18:28 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Fri, 20 Aug 2010 07:57:06 +0000 (11:57 +0400)
java/java-impl/src/com/intellij/slicer/SliceLeafAnalyzer.java

index 31e7a3b39e9060aca60e26800f463f91cee714e7..d759d48f10e300c39f6707370b203e58734b04ba 100644 (file)
@@ -33,9 +33,9 @@ import com.intellij.psi.WalkingState;
 import com.intellij.psi.impl.source.tree.SourceUtil;
 import com.intellij.util.NullableFunction;
 import com.intellij.util.PairProcessor;
+import com.intellij.util.containers.ConcurrentHashMap;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.FactoryMap;
-import gnu.trove.THashMap;
 import gnu.trove.THashSet;
 import gnu.trove.TObjectHashingStrategy;
 import org.jetbrains.annotations.NotNull;
@@ -172,10 +172,10 @@ public class SliceLeafAnalyzer {
   }
 
   public static Map<SliceNode, Collection<PsiElement>> createMap() {
-    final Map<SliceNode, Collection<PsiElement>> map = new FactoryMap<SliceNode, Collection<PsiElement>>() {
+    return new FactoryMap<SliceNode, Collection<PsiElement>>() {
       @Override
       protected Map<SliceNode, Collection<PsiElement>> createMap() {
-        return new THashMap<SliceNode, Collection<PsiElement>>(TObjectHashingStrategy.IDENTITY);
+        return new ConcurrentHashMap<SliceNode, Collection<PsiElement>>(TObjectHashingStrategy.IDENTITY);
       }
 
       @Override
@@ -183,7 +183,6 @@ public class SliceLeafAnalyzer {
         return new THashSet<PsiElement>(SliceLeafAnalyzer.LEAF_ELEMENT_EQUALITY);
       }
     };
-    return map;
   }
 
   static class SliceNodeGuide implements WalkingState.TreeGuide<SliceNode> {