Skip to content

Commit 8a8f874

Browse files
authored
Switch to ConcurrentHashMap in SeqClassHierarchyFactory (#1379)
I believe this should address #1377. See 74b6c74. For some reason at that point we decided not to use the type system to enforce use of a `ConcurrentHashMap` always. In this spirit of trying not to break things I didn't do that here, but instead changed `SeqClassHierarchyFactory` to use `ConcurrentHashMap`. Fixes #1377 (though we can reopen if the crash still happens)
1 parent 45fa20f commit 8a8f874

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

core/src/main/java/com/ibm/wala/ipa/cha/SeqClassHierarchyFactory.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import com.ibm.wala.classLoader.Language;
1616
import com.ibm.wala.ipa.callgraph.AnalysisScope;
1717
import com.ibm.wala.util.MonitorUtil.IProgressMonitor;
18-
import com.ibm.wala.util.collections.HashMapFactory;
1918
import java.util.Set;
19+
import java.util.concurrent.ConcurrentHashMap;
2020

2121
public class SeqClassHierarchyFactory {
2222

@@ -51,7 +51,11 @@ public static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factor
5151
throw new IllegalArgumentException("null factory");
5252
}
5353
return new ClassHierarchy(
54-
scope, factory, null, HashMapFactory.make(), ClassHierarchy.MissingSuperClassHandling.NONE);
54+
scope,
55+
factory,
56+
null,
57+
new ConcurrentHashMap<>(),
58+
ClassHierarchy.MissingSuperClassHandling.NONE);
5559
}
5660

5761
/**
@@ -65,7 +69,7 @@ public static ClassHierarchy make(
6569
scope,
6670
factory,
6771
monitor,
68-
HashMapFactory.make(),
72+
new ConcurrentHashMap<>(),
6973
ClassHierarchy.MissingSuperClassHandling.NONE);
7074
}
7175

@@ -77,7 +81,7 @@ public static ClassHierarchy make(
7781
factory,
7882
languages,
7983
null,
80-
HashMapFactory.make(),
84+
new ConcurrentHashMap<>(),
8185
ClassHierarchy.MissingSuperClassHandling.NONE);
8286
}
8387

@@ -89,7 +93,7 @@ public static ClassHierarchy make(
8993
factory,
9094
language,
9195
null,
92-
HashMapFactory.make(),
96+
new ConcurrentHashMap<>(),
9397
ClassHierarchy.MissingSuperClassHandling.NONE);
9498
}
9599

@@ -108,7 +112,7 @@ public static ClassHierarchy make(
108112
factory,
109113
language,
110114
monitor,
111-
HashMapFactory.make(),
115+
new ConcurrentHashMap<>(),
112116
ClassHierarchy.MissingSuperClassHandling.NONE);
113117
}
114118
}

0 commit comments

Comments
 (0)