diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java index 8af0660be6..34a0e60dc0 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java @@ -199,7 +199,7 @@ public class ConcurrentLongHashMap { private long[] keys; private V[] values; - private int capacity; + private volatile int capacity; private volatile int size; private int usedBuckets; private int resizeThreshold; @@ -457,10 +457,10 @@ public class ConcurrentLongHashMap { } } - capacity = newCapacity; keys = newKeys; values = newValues; usedBuckets = size; + capacity = newCapacity; resizeThreshold = (int) (capacity * MapFillFactor); }