commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections LRUMap.java
Date Sun, 10 Feb 2002 12:56:39 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message