1454 |
|
|
1455 |
|
@SuppressWarnings("unchecked") |
1456 |
|
public boolean tryAdvance(Consumer<? super E> action) { |
1457 |
+ |
Objects.requireNonNull(action); |
1458 |
|
int i; |
1458 |
– |
if (action == null) |
1459 |
– |
throw new NullPointerException(); |
1459 |
|
if (getFence() > (i = index)) { |
1460 |
|
index = i + 1; |
1461 |
|
action.accept((E)array[i]); |
1468 |
|
|
1469 |
|
@SuppressWarnings("unchecked") |
1470 |
|
public void forEachRemaining(Consumer<? super E> action) { |
1471 |
< |
if (action == null) |
1473 |
< |
throw new NullPointerException(); |
1471 |
> |
Objects.requireNonNull(action); |
1472 |
|
final int hi = getFence(); |
1473 |
|
final Object[] a = array; |
1474 |
|
int i; |