You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/02/10 13:56:39 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections LRUMap.java

jstrachan    02/02/10 04:56:39

  Modified:    collections/src/java/org/apache/commons/collections
                        LRUMap.java
  Log:
  Patched the LRUMap so that remove() does indeed remove items from the bubble list
  
  Revision  Changes    Path
  1.3       +8 -4      jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java
  
  Index: LRUMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/LRUMap.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LRUMap.java	10 Feb 2002 08:07:42 -0000	1.2
  +++ LRUMap.java	10 Feb 2002 12:56:39 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /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/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 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 ) {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>