You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Lukasz Kowalczyk <lu...@jazzpolice.pl> on 2002/09/11 21:28:40 UTC

HashMapObjectCache not respecting max size parameter

It looks like org.apache.slide.util.HashMapObjectCache does not
respect maxSize parameter passed in constructor. Maybe the patch
included below makes sense:

--- HashMapObjectCache.java.bak Wed Sep 11 21:28:01 2002
+++ HashMapObjectCache.java     Wed Sep 11 21:28:16 2002
@@ -153,7 +153,8 @@
      */
     public void put(Object key, Object value) {
         synchronized (cache) {
-            cache.put(key, value);
+            if (getSize() < maxSize)
+                cache.put(key, value);
         }
     }
     
-- 
Lukasz Kowalczyk


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>