asmuts 2004/11/15 23:33:11
Modified: src/java/org/apache/jcs/engine/memory/lru
LRUMemoryCache.java
Log:
Moved removal in update into synchronized block. This solved the periodic
map != list error.
Revision Changes Path
1.27 +8 -9
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
Index: LRUMemoryCache.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- LRUMemoryCache.java 13 Jul 2004 02:11:45 -0000 1.26
+++ LRUMemoryCache.java 16 Nov 2004 07:33:11 -0000 1.27
@@ -96,14 +96,13 @@
getFirst()).ce.getKey(),
(MemoryElementDescriptor) list.
getFirst());
- }
-
- // If the node was the same as an existing node, remove it.
- if (old != null &&
- ( (MemoryElementDescriptor) list.getFirst()).ce.getKey().
- equals(old.ce.getKey()))
- {
- list.remove(old);
+ // If the node was the same as an existing node, remove it.
+ if (old != null &&
+ ( (MemoryElementDescriptor) list.getFirst()).ce.getKey().
+ equals(old.ce.getKey()))
+ {
+ list.remove(old);
+ }
}
int size = map.size();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]