commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joc...@apache.org
Subject svn commit: r1076039 - in /commons/proper/collections: branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java
Date Tue, 01 Mar 2011 22:35:01 GMT
Author: jochen
Date: Tue Mar  1 22:35:01 2011
New Revision: 1076039

URL: http://svn.apache.org/viewvc?rev=1076039&view=rev
Log:
PR: COLLECTIONS-334
Synchronizing access to locks in StaticBucketMap.size()

Modified:
    commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java

Modified: commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java?rev=1076039&r1=1076038&r2=1076039&view=diff
==============================================================================
--- commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java
(original)
+++ commons/proper/collections/branches/COLLECTIONS_3_2_BRANCH/src/java/org/apache/commons/collections/map/StaticBucketMap.java
Tue Mar  1 22:35:01 2011
@@ -182,7 +182,9 @@ public final class StaticBucketMap imple
         int cnt = 0;
 
         for (int i = 0; i < buckets.length; i++) {
-            cnt += locks[i].size;
+            synchronized(locks[i]) {
+                cnt += locks[i].size;
+            }
         }
         return cnt;
     }

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java?rev=1076039&r1=1076038&r2=1076039&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/StaticBucketMap.java
Tue Mar  1 22:35:01 2011
@@ -183,7 +183,9 @@ public final class StaticBucketMap<K, V>
         int cnt = 0;
 
         for (int i = 0; i < buckets.length; i++) {
-            cnt += locks[i].size;
+            synchronized(locks[i]) {
+                cnt += locks[i].size;
+            }
         }
         return cnt;
     }



Mime
View raw message