[cvs] / jsr166 / src / main / java / util / concurrent / LinkedTransferQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.111

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8