Author: toad
Date: 2007-03-11 00:11:08 +0000 (Sun, 11 Mar 2007)
New Revision: 12097

Modified:
   trunk/freenet/src/freenet/support/TimeSortedHashtable.java
Log:
Fix bug that would cause inconsistency in TimeSortedHashtable.popValue.
(In practice this would only happen after a week...)

Modified: trunk/freenet/src/freenet/support/TimeSortedHashtable.java
===================================================================
--- trunk/freenet/src/freenet/support/TimeSortedHashtable.java  2007-03-11 
00:06:41 UTC (rev 12096)
+++ trunk/freenet/src/freenet/support/TimeSortedHashtable.java  2007-03-11 
00:11:08 UTC (rev 12097)
@@ -88,6 +88,7 @@
     } 

     /**
+     * Remove and return the least recently pushed value.
      * @return Least recently pushed value.
      */
     public final synchronized Comparable popValue() {
@@ -95,6 +96,7 @@

        Element e = (Element) elements.first();
        valueToElement.remove(e.value);
+       elements.remove(e);

        assert(elements.size() == valueToElement.size());
        return e.value;


Reply via email to