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.141 by jsr166, Thu Dec 8 05:04:44 2016 UTC vs.
Revision 1.142 by jsr166, Sat Dec 24 19:32:07 2016 UTC

# Line 779 | Line 779 | public class CopyOnWriteArrayList<E>
779       * @throws NullPointerException {@inheritDoc}
780       */
781      public void forEach(Consumer<? super E> action) {
782 <        if (action == null) throw new NullPointerException();
782 >        Objects.requireNonNull(action);
783          for (Object x : getArray()) {
784              @SuppressWarnings("unchecked") E e = (E) x;
785              action.accept(e);
# Line 790 | Line 790 | public class CopyOnWriteArrayList<E>
790       * @throws NullPointerException {@inheritDoc}
791       */
792      public boolean removeIf(Predicate<? super E> filter) {
793 <        if (filter == null) throw new NullPointerException();
793 >        Objects.requireNonNull(filter);
794          return bulkRemove(filter);
795      }
796  
# Line 847 | Line 847 | public class CopyOnWriteArrayList<E>
847      }
848  
849      public void replaceAll(UnaryOperator<E> operator) {
850 <        if (operator == null) throw new NullPointerException();
850 >        Objects.requireNonNull(operator);
851          synchronized (lock) {
852              replaceAll(operator, 0, getArray().length);
853          }
# Line 1311 | Line 1311 | public class CopyOnWriteArrayList<E>
1311          }
1312  
1313          public void forEach(Consumer<? super E> action) {
1314 <            if (action == null) throw new NullPointerException();
1314 >            Objects.requireNonNull(action);
1315              int i, end; final Object[] es;
1316              synchronized (l.lock) {
1317                  es = getArrayChecked();
# Line 1323 | Line 1323 | public class CopyOnWriteArrayList<E>
1323          }
1324  
1325          public void replaceAll(UnaryOperator<E> operator) {
1326 <            if (operator == null) throw new NullPointerException();
1326 >            Objects.requireNonNull(operator);
1327              synchronized (l.lock) {
1328                  checkForComodification();
1329                  l.replaceAll(operator, offset, offset + size);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines