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

Comparing jsr166/src/main/java/util/concurrent/DelayQueue.java (file contents):
Revision 1.73 by jsr166, Wed Nov 30 03:46:37 2016 UTC vs.
Revision 1.74 by jsr166, Sat Dec 24 19:32:07 2016 UTC

# Line 12 | Line 12 | import java.util.AbstractQueue;
12   import java.util.Collection;
13   import java.util.Iterator;
14   import java.util.NoSuchElementException;
15 + import java.util.Objects;
16   import java.util.PriorityQueue;
17   import java.util.concurrent.locks.Condition;
18   import java.util.concurrent.locks.ReentrantLock;
# Line 310 | Line 311 | public class DelayQueue<E extends Delaye
311       * @throws IllegalArgumentException      {@inheritDoc}
312       */
313      public int drainTo(Collection<? super E> c) {
314 <        if (c == null)
314 <            throw new NullPointerException();
314 >        Objects.requireNonNull(c);
315          if (c == this)
316              throw new IllegalArgumentException();
317          final ReentrantLock lock = this.lock;
# Line 336 | Line 336 | public class DelayQueue<E extends Delaye
336       * @throws IllegalArgumentException      {@inheritDoc}
337       */
338      public int drainTo(Collection<? super E> c, int maxElements) {
339 <        if (c == null)
340 <            throw new NullPointerException();
339 >        Objects.requireNonNull(c);
340          if (c == this)
341              throw new IllegalArgumentException();
342          if (maxElements <= 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines