You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2008/03/14 21:29:09 UTC
svn commit: r637250 -
/lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java
Author: rfrovarp
Date: Fri Mar 14 13:29:08 2008
New Revision: 637250
URL: http://svn.apache.org/viewvc?rev=637250&view=rev
Log:
The elements in timeToKey weren't being removed as firstKey doesn't do a removal, just a return. This should now work properly.
Modified:
lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java
Modified: lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java?rev=637250&r1=637249&r2=637250&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/util/CacheMap.java Fri Mar 14 13:29:08 2008
@@ -59,7 +59,9 @@
public Object put(Object key, Object value) {
if (size() == this.capacity) {
- Object oldestKey = this.timeToKey.get(this.timeToKey.firstKey());
+ Object timeKey = this.timeToKey.firstKey();
+ Object oldestKey = this.timeToKey.get(timeKey);
+ this.timeToKey.remove(timeKey);
remove(oldestKey);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Clearing cache");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org