Unverified Commit 0e2c4d4a authored by Wu Yongzheng's avatar Wu Yongzheng Committed by GitHub

fix thread-safe bug

wrap WeakHashMap with Collections.synchronizedMap, because it can be used by many worker threads.
parent f101e9a7
...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; ...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
public class ClspGraph { public class ClspGraph {
private static final Logger LOG = LoggerFactory.getLogger(ClspGraph.class); private static final Logger LOG = LoggerFactory.getLogger(ClspGraph.class);
private final Map<String, Set<String>> ancestorCache = new WeakHashMap<String, Set<String>>(); private final Map<String, Set<String>> ancestorCache = Collections.synchronizedMap(new WeakHashMap<String, Set<String>>());
private Map<String, NClass> nameMap; private Map<String, NClass> nameMap;
private final Set<String> missingClasses = new HashSet<String>(); private final Set<String> missingClasses = new HashSet<String>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment