src/share/classes/java/util/LinkedList.java

Print this page
rev 6977 : [mq]: iterator

@@ -955,10 +955,11 @@
             while (modCount == expectedModCount && nextIndex < size) {
                 action.accept(next.item);
                 next = next.next;
                 nextIndex++;
             }
+            lastReturned = next;
             checkForComodification();
         }
 
         final void checkForComodification() {
             if (modCount != expectedModCount)