Use synchronized wrapper for NodeMap backings

This commit is contained in:
Luck 2018-07-12 09:50:10 -07:00
parent da3c2a073a
commit 01ffe6ad5a
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -84,18 +84,22 @@ public final class NodeMap {
* key, and finally by the overall size of the set. Nodes are ordered according to the priority rules
* defined in {@link NodeComparator}.</p>
*/
private final SortedSetMultimap<ImmutableContextSet, LocalizedNode> map = Multimaps.newSortedSetMultimap(
new ConcurrentSkipListMap<>(ContextSetComparator.reverse()),
VALUE_SET_SUPPLIER
private final SortedSetMultimap<ImmutableContextSet, LocalizedNode> map = Multimaps.synchronizedSortedSetMultimap(
Multimaps.newSortedSetMultimap(
new ConcurrentSkipListMap<>(ContextSetComparator.reverse()),
VALUE_SET_SUPPLIER
)
);
/**
* Copy of {@link #map} which only contains group nodes
* @see Node#isGroupNode()
*/
private final SortedSetMultimap<ImmutableContextSet, LocalizedNode> inheritanceMap = Multimaps.newSortedSetMultimap(
new ConcurrentSkipListMap<>(ContextSetComparator.reverse()),
VALUE_SET_SUPPLIER
private final SortedSetMultimap<ImmutableContextSet, LocalizedNode> inheritanceMap = Multimaps.synchronizedSortedSetMultimap(
Multimaps.newSortedSetMultimap(
new ConcurrentSkipListMap<>(ContextSetComparator.reverse()),
VALUE_SET_SUPPLIER
)
);
/**