13 |
|
import java.util.Collection; |
14 |
|
import java.util.Collections; |
15 |
|
import java.util.Iterator; |
16 |
+ |
import java.util.Objects; |
17 |
|
import java.util.Spliterator; |
18 |
|
import java.util.Spliterators; |
19 |
|
import java.util.concurrent.locks.LockSupport; |
1084 |
|
* @throws IllegalArgumentException {@inheritDoc} |
1085 |
|
*/ |
1086 |
|
public int drainTo(Collection<? super E> c) { |
1087 |
< |
if (c == null) |
1087 |
< |
throw new NullPointerException(); |
1087 |
> |
Objects.requireNonNull(c); |
1088 |
|
if (c == this) |
1089 |
|
throw new IllegalArgumentException(); |
1090 |
|
int n = 0; |
1102 |
|
* @throws IllegalArgumentException {@inheritDoc} |
1103 |
|
*/ |
1104 |
|
public int drainTo(Collection<? super E> c, int maxElements) { |
1105 |
< |
if (c == null) |
1106 |
< |
throw new NullPointerException(); |
1105 |
> |
Objects.requireNonNull(c); |
1106 |
|
if (c == this) |
1107 |
|
throw new IllegalArgumentException(); |
1108 |
|
int n = 0; |