You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by ka...@apache.org on 2009/10/26 20:07:30 UTC

svn commit: r829901 - /incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java

Author: kaosko
Date: Mon Oct 26 19:07:30 2009
New Revision: 829901

URL: http://svn.apache.org/viewvc?rev=829901&view=rev
Log:
Add the new value in put() to strongreferences queue by default to solve the test reliability issue with SHIRO-96 (because account info in memory realms may get garbage collected). However, this doesn't ultimately solve the issue as values that don't fit to strong references would still get garbage collected. Additionally, there's no need to use a cache for memory realms anyway - see SHIRO-49 for that.

Modified:
    incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java

Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java?rev=829901&r1=829900&r2=829901&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/SoftHashMap.java Mon Oct 26 19:07:30 2009
@@ -249,6 +249,7 @@
         processQueue(); // throw out garbage collected values first
         SoftValue<V, K> sv = new SoftValue<V, K>(value, key, queue);
         SoftValue<V, K> previous = map.put(key, sv);
+        addToStrongReferences(value);
         return previous != null ? previous.get() : null;
     }