Author: toad
Date: 2006-05-12 17:13:34 +0000 (Fri, 12 May 2006)
New Revision: 8681

Modified:
   trunk/freenet/src/freenet/node/Version.java
   trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java
Log:
701:
Maybe fix long-standing bug in DoublyLinkedList reported most recently by 
Zothar.

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-05-12 17:00:38 UTC (rev 
8680)
+++ trunk/freenet/src/freenet/node/Version.java 2006-05-12 17:13:34 UTC (rev 
8681)
@@ -18,7 +18,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       private static final int buildNumber = 700;
+       private static final int buildNumber = 701;

        /** Oldest build of Fred we will talk to */
        private static final int lastGoodBuild = 591;

Modified: trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java
===================================================================
--- trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2006-05-12 
17:00:38 UTC (rev 8680)
+++ trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2006-05-12 
17:13:34 UTC (rev 8681)
@@ -73,13 +73,13 @@
        DoublyLinkedList.Item pos = _headptr.next;
        DoublyLinkedList.Item opos = _headptr;
        while(true) {
+               if(pos == _tailptr) break;
                if(pos == null) break;
                pos.setParent(null);
                pos.setPrev(null);
                opos = pos;
                pos = pos.getNext();
                opos.setNext(null);
-               if(pos == _tailptr) break;
        }
         _headptr.next = _tailptr;
         _tailptr.prev = _headptr;
@@ -266,6 +266,8 @@
      * Inserts item J before item I (going from head to tail).
      */
     public void insertPrev(DoublyLinkedList.Item i, DoublyLinkedList.Item j) {
+       if (i.getParent() == null)
+               throw new PromiscuousItemException(i, i.getParent()); // 
different trace to make easier debugging
        if (i.getParent() != this)
                throw new PromiscuousItemException(i, i.getParent());
        if (j.getParent() != null)


Reply via email to