From 01ffe6ad5a6e273556e045accb12b5230d3a7f79 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 12 Jul 2018 09:50:10 -0700 Subject: [PATCH] Use synchronized wrapper for NodeMap backings --- .../me/lucko/luckperms/common/model/NodeMap.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java b/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java index 2996c335..f77bbbd9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java @@ -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}.

*/ - private final SortedSetMultimap map = Multimaps.newSortedSetMultimap( - new ConcurrentSkipListMap<>(ContextSetComparator.reverse()), - VALUE_SET_SUPPLIER + private final SortedSetMultimap 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 inheritanceMap = Multimaps.newSortedSetMultimap( - new ConcurrentSkipListMap<>(ContextSetComparator.reverse()), - VALUE_SET_SUPPLIER + private final SortedSetMultimap inheritanceMap = Multimaps.synchronizedSortedSetMultimap( + Multimaps.newSortedSetMultimap( + new ConcurrentSkipListMap<>(ContextSetComparator.reverse()), + VALUE_SET_SUPPLIER + ) ); /**