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

Comparing jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java (file contents):
Revision 1.132 by jsr166, Mon Aug 3 19:20:17 2015 UTC vs.
Revision 1.133 by jsr166, Fri Sep 18 02:06:44 2015 UTC

# Line 1109 | Line 1109 | public class CopyOnWriteArrayList<E>
1109          public void add(E e) {
1110              throw new UnsupportedOperationException();
1111          }
1112 +
1113 +        @Override
1114 +        @SuppressWarnings("unchecked")
1115 +        public void forEachRemaining(Consumer<? super E> action) {
1116 +            Objects.requireNonNull(action);
1117 +            final int size = snapshot.length;
1118 +            for (int i = cursor; i < size; i++) {
1119 +                action.accept((E) snapshot[i]);
1120 +            }
1121 +            cursor = size;
1122 +        }
1123      }
1124  
1125      /**
# Line 1502 | Line 1513 | public class CopyOnWriteArrayList<E>
1513          public void add(E e) {
1514              throw new UnsupportedOperationException();
1515          }
1516 +
1517 +        @Override
1518 +        @SuppressWarnings("unchecked")
1519 +        public void forEachRemaining(Consumer<? super E> action) {
1520 +            Objects.requireNonNull(action);
1521 +            while (nextIndex() < size) {
1522 +                action.accept(it.next());
1523 +            }
1524 +        }
1525      }
1526  
1527      // Support for resetting lock while deserializing

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines