[hornetq-commits] JBoss hornetq SVN: r12221 - branches/Branch_2_2_AS7/src/main/org/hornetq/utils.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Mar 1 10:22:37 EST 2012


Author: clebert.suconic
Date: 2012-03-01 10:22:36 -0500 (Thu, 01 Mar 2012)
New Revision: 12221

Modified:
   branches/Branch_2_2_AS7/src/main/org/hornetq/utils/LinkedListImpl.java
Log:
JBPAPP-8282 - better fix

Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/utils/LinkedListImpl.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/utils/LinkedListImpl.java	2012-03-01 13:58:24 UTC (rev 12220)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/utils/LinkedListImpl.java	2012-03-01 15:22:36 UTC (rev 12221)
@@ -34,7 +34,7 @@
 
    private static final int INITIAL_ITERATOR_ARRAY_SIZE = 10;
 
-   private Node<E> head = new Node<E>(null);
+   private final Node<E> head = new Node<E>(null);
 
    private Node<E> tail = null;
 
@@ -55,7 +55,7 @@
    public void addHead(E e)
    {
       Node<E> node = new Node<E>(e);
-
+      
       node.next = head.next;
 
       node.prev = head;
@@ -65,10 +65,11 @@
       if (size == 0)
       {
          tail = node;
-      } 
-      else 
+      }
+      else
       {
-         tail.prev = node;
+         // Need to set the previous element on the former head
+         node.next.prev = node;
       }
 
       size++;



More information about the hornetq-commits mailing list