3 Replies Latest reply on Jul 13, 2004 4:58 PM by arni2004

    Infinite loop in LRUAlgorithm

    arni2004 Newbie

      We experience that the LRUAlgorithm goes into an infinite loop.

      The problem seems to be the following code:

      (code snippet from removeFromQueue)

      ne.getPrevious().setNext(ne.getPrevious());
      ne.getNext().setPrevious(ne.getNext());

      causing a loop in the linked list. my guess is that this will do better:

      ne.getPrevious().setNext(ne.getNext());
      ne.getNext().setPrevious(ne.getPrevious());