activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/3] activemq-artemis git commit: ARTEMIS-1664 fix npe bug while getting element in the process of rehash
Date Fri, 23 Feb 2018 01:48:26 GMT
ARTEMIS-1664 fix npe bug while getting element in the process of rehash

Apply same fix to ConcurrentLongHashSet

Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2c32dda3
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2c32dda3
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2c32dda3

Branch: refs/heads/master
Commit: 2c32dda39e4edab7d34e3fb0db8217944df33977
Parents: 6509c07
Author: Michael André Pearce <michael.andre.pearce@me.com>
Authored: Thu Feb 22 23:20:56 2018 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Feb 22 20:47:42 2018 -0500

----------------------------------------------------------------------
 .../artemis/utils/collections/ConcurrentLongHashSet.java         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2c32dda3/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java
index 17d94b7..8344c57 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashSet.java
@@ -165,7 +165,7 @@ public class ConcurrentLongHashSet {
       // Keys and values are stored interleaved in the table array
       private long[] table;
 
-      private int capacity;
+      private volatile int capacity;
       private volatile int size;
       private int usedBuckets;
       private int resizeThreshold;
@@ -374,9 +374,9 @@ public class ConcurrentLongHashSet {
             }
          }
 
-         capacity = newCapacity;
          table = newTable;
          usedBuckets = size;
+         capacity = newCapacity;
          resizeThreshold = (int) (capacity * SetFillFactor);
       }
 


Mime
View raw message