From 328f30989e98db21269bcb41e9d7c6fbffca9ace Mon Sep 17 00:00:00 2001 From: James Strachan Date: Sun, 10 Feb 2002 12:56:39 +0000 Subject: [PATCH] Patched the LRUMap so that remove() does indeed remove items from the bubble list git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130512 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/collections/LRUMap.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/collections/LRUMap.java b/src/java/org/apache/commons/collections/LRUMap.java index 79c99b1f3..a05de165f 100644 --- a/src/java/org/apache/commons/collections/LRUMap.java +++ b/src/java/org/apache/commons/collections/LRUMap.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/LRUMap.java,v 1.2 2002/02/10 08:07:42 jstrachan Exp $ - * $Revision: 1.2 $ - * $Date: 2002/02/10 08:07:42 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/LRUMap.java,v 1.3 2002/02/10 12:56:39 jstrachan Exp $ + * $Revision: 1.3 $ + * $Date: 2002/02/10 12:56:39 $ * * ==================================================================== * @@ -198,7 +198,11 @@ public class LRUMap extends HashMap implements Externalizable { public Object remove( Object key ) { ValuePositionPair pair = removePair( key ); - return ( pair != null ) ? pair.value : null; + if ( pair != null ) { + bubbleList.remove( pair.position ); + return pair.value; + } + return null; } public boolean containsKey( Object key ) {