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

Comparing jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java (file contents):
Revision 1.110 by jsr166, Sat Dec 24 18:37:26 2016 UTC vs.
Revision 1.111 by jsr166, Sat Dec 24 19:32:07 2016 UTC

# Line 13 | Line 13 | import java.util.Arrays;
13   import java.util.Collection;
14   import java.util.Iterator;
15   import java.util.NoSuchElementException;
16 + import java.util.Objects;
17   import java.util.Queue;
18   import java.util.Spliterator;
19   import java.util.Spliterators;
# Line 877 | Line 878 | public class LinkedTransferQueue<E> exte
878       */
879      @SuppressWarnings("unchecked")
880      public <T> T[] toArray(T[] a) {
881 <        if (a == null) throw new NullPointerException();
881 >        Objects.requireNonNull(a);
882          return (T[]) toArrayInternal(a);
883      }
884  
# Line 1019 | Line 1020 | public class LinkedTransferQueue<E> exte
1020  
1021          @SuppressWarnings("unchecked")
1022          public void forEachRemaining(Consumer<? super E> action) {
1023 +            Objects.requireNonNull(action);
1024              Node p;
1023            if (action == null) throw new NullPointerException();
1025              if (!exhausted &&
1026                  ((p = current) != null || (p = firstDataNode()) != null)) {
1027                  current = null;
# Line 1041 | Line 1042 | public class LinkedTransferQueue<E> exte
1042  
1043          @SuppressWarnings("unchecked")
1044          public boolean tryAdvance(Consumer<? super E> action) {
1045 +            Objects.requireNonNull(action);
1046              Node p;
1045            if (action == null) throw new NullPointerException();
1047              if (!exhausted &&
1048                  ((p = current) != null || (p = firstDataNode()) != null)) {
1049                  Object item;
# Line 1317 | Line 1318 | public class LinkedTransferQueue<E> exte
1318       * @throws IllegalArgumentException {@inheritDoc}
1319       */
1320      public int drainTo(Collection<? super E> c) {
1321 <        if (c == null)
1321 <            throw new NullPointerException();
1321 >        Objects.requireNonNull(c);
1322          if (c == this)
1323              throw new IllegalArgumentException();
1324          int n = 0;
# Line 1334 | Line 1334 | public class LinkedTransferQueue<E> exte
1334       * @throws IllegalArgumentException {@inheritDoc}
1335       */
1336      public int drainTo(Collection<? super E> c, int maxElements) {
1337 <        if (c == null)
1338 <            throw new NullPointerException();
1337 >        Objects.requireNonNull(c);
1338          if (c == this)
1339              throw new IllegalArgumentException();
1340          int n = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines