jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1143396 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java
Date Wed, 06 Jul 2011 13:09:39 GMT
Author: stefan
Date: Wed Jul  6 13:09:38 2011
New Revision: 1143396

URL: http://svn.apache.org/viewvc?rev=1143396&view=rev
Log:
JCR-3013: ArrayIndexOutOfBoundsException: ConcurrentCache

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java?rev=1143396&r1=1143395&r2=1143396&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cache/AbstractCache.java
Wed Jul  6 13:09:38 2011
@@ -95,6 +95,11 @@ public abstract class AbstractCache impl
      */
     protected void recordCacheAccess() {
         int count = accessCount.incrementAndGet();
+        // guard against integer overflow
+        if (count < 0) {
+            accessCount.set(0);
+            count = accessCount.incrementAndGet();
+        }
         if (count % ACCESS_INTERVAL == 0) {
             CacheAccessListener listener = accessListener.get();
             if (listener != null) {



Mime
View raw message