ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/ArrayDeque.java
(Generate patch)

Comparing jsr166/src/main/java/util/ArrayDeque.java (file contents):
Revision 1.67 by jsr166, Thu Sep 10 00:05:48 2015 UTC vs.
Revision 1.68 by jsr166, Thu Sep 17 14:27:56 2015 UTC

# Line 608 | Line 608 | public class ArrayDeque<E> extends Abstr
608              }
609              lastRet = -1;
610          }
611 +
612 +        public void forEachRemaining(Consumer<? super E> action) {
613 +            Objects.requireNonNull(action);
614 +            Object[] a = elements;
615 +            int m = a.length - 1, f = fence, i = cursor;
616 +            cursor = f;
617 +            while (i != f) {
618 +                @SuppressWarnings("unchecked") E e = (E)a[i];
619 +                i = (i + 1) & m;
620 +                if (e == null)
621 +                    throw new ConcurrentModificationException();
622 +                action.accept(e);
623 +            }
624 +        }
625      }
626  
627      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines