src/share/classes/java/util/LinkedList.java
Print this page
*** 952,965 ****
public void forEachRemaining(Consumer<? super E> action) {
Objects.requireNonNull(action);
while (modCount == expectedModCount && nextIndex < size) {
action.accept(next.item);
next = next.next;
nextIndex++;
}
- lastReturned = next;
checkForComodification();
}
final void checkForComodification() {
if (modCount != expectedModCount)
--- 952,965 ----
public void forEachRemaining(Consumer<? super E> action) {
Objects.requireNonNull(action);
while (modCount == expectedModCount && nextIndex < size) {
action.accept(next.item);
+ lastReturned = next;
next = next.next;
nextIndex++;
}
checkForComodification();
}
final void checkForComodification() {
if (modCount != expectedModCount)