fix thread-safe bug
wrap WeakHashMap with Collections.synchronizedMap, because it can be used by many worker threads.
This commit is contained in:
@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
|
||||
public class ClspGraph {
|
||||
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 final Set<String> missingClasses = new HashSet<String>();
|
||||
|
||||
Reference in New Issue
Block a user