cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r425629 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Date Wed, 26 Jul 2006 05:09:04 GMT
Author: antonio
Date: Tue Jul 25 22:09:03 2006
New Revision: 425629

URL: http://svn.apache.org/viewvc?rev=425629&view=rev
Log:

<action dev="AG" type="fix" fixes-bug="COCOON-1885" due-to="Ard Schrijvers" due-to-email="a.schrijvers@hippo.nl">
  Core: EHDefaultStore returns in the size() method the wrong number of keys.
</action>

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?rev=425629&r1=425628&r2=425629&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Tue Jul 25 22:09:03 2006
@@ -444,8 +444,10 @@
      */
     public int size() {
         try {
-            return this.cache.getSize();
-        } catch (CacheException e) {
+            // cast to int due ehcache implementation returns a long instead of int.
+            // See: http://ehcache.sourceforge.net/javadoc/net/sf/ehcache/Cache.html#getMemoryStoreSize()
+            return (int)this.cache.getMemoryStoreSize();
+        } catch (IllegalStateException e) {
             if (getLogger().isWarnEnabled()) {
                 getLogger().warn("Error while getting cache size", e);
             }



Mime
View raw message