779 |
|
* @throws NullPointerException {@inheritDoc} |
780 |
|
*/ |
781 |
|
public void forEach(Consumer<? super E> action) { |
782 |
< |
if (action == null) throw new NullPointerException(); |
782 |
> |
Objects.requireNonNull(action); |
783 |
|
for (Object x : getArray()) { |
784 |
|
@SuppressWarnings("unchecked") E e = (E) x; |
785 |
|
action.accept(e); |
790 |
|
* @throws NullPointerException {@inheritDoc} |
791 |
|
*/ |
792 |
|
public boolean removeIf(Predicate<? super E> filter) { |
793 |
< |
if (filter == null) throw new NullPointerException(); |
793 |
> |
Objects.requireNonNull(filter); |
794 |
|
return bulkRemove(filter); |
795 |
|
} |
796 |
|
|
847 |
|
} |
848 |
|
|
849 |
|
public void replaceAll(UnaryOperator<E> operator) { |
850 |
< |
if (operator == null) throw new NullPointerException(); |
850 |
> |
Objects.requireNonNull(operator); |
851 |
|
synchronized (lock) { |
852 |
|
replaceAll(operator, 0, getArray().length); |
853 |
|
} |
1311 |
|
} |
1312 |
|
|
1313 |
|
public void forEach(Consumer<? super E> action) { |
1314 |
< |
if (action == null) throw new NullPointerException(); |
1314 |
> |
Objects.requireNonNull(action); |
1315 |
|
int i, end; final Object[] es; |
1316 |
|
synchronized (l.lock) { |
1317 |
|
es = getArrayChecked(); |
1323 |
|
} |
1324 |
|
|
1325 |
|
public void replaceAll(UnaryOperator<E> operator) { |
1326 |
< |
if (operator == null) throw new NullPointerException(); |
1326 |
> |
Objects.requireNonNull(operator); |
1327 |
|
synchronized (l.lock) { |
1328 |
|
checkForComodification(); |
1329 |
|
l.replaceAll(operator, offset, offset + size); |