User: salborini
  Date: 00/10/18 09:23:25

  Modified:    src/main/org/jboss/util LRUCachePolicy.java
  Log:
  demote() used to try and remove the entry twice.
  
  Revision  Changes    Path
  1.2       +4 -2      jboss/src/main/org/jboss/util/LRUCachePolicy.java
  
  Index: LRUCachePolicy.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/util/LRUCachePolicy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LRUCachePolicy.java       2000/10/16 23:20:50     1.1
  +++ LRUCachePolicy.java       2000/10/18 16:23:24     1.2
  @@ -12,7 +12,7 @@
    * Implementation of a Least Recently Used cache policy.
    *
    * @author Simone Bordet ([EMAIL PROTECTED])
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class LRUCachePolicy 
        implements CachePolicy
  @@ -198,6 +198,7 @@
         */
        protected void ageOut(LRUCacheEntry entry) 
        {
  +        remove(entry);
        }
        /**
         * Callback method called when a cache miss happens.
  @@ -318,7 +319,8 @@
                        if (m_count == m_capacity) 
                        {
                                LRUCacheEntry entry = m_tail;
  -                             remove(entry);
  +                             
  +                             // the entry will be removed by ageOut
                                ageOut(entry);                          
                        }
                        else {} // cache is not full, do nothing
  
  
  

Reply via email to