-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 27
-
Component/s: core-libs
`Stream.forEach(Consumer<? super T> action)`, `Spliterator.forEachRemaining(Consumer<? super T> action)` and `Spliterator.tryAdvance(Consumer<? super T> action)` specify they throw `NullPointerException` if their argument is `null`. In prior releases, implementations of `Spliterator` and `Stream` for subsets of `TreeMap` and `TreeSet` did not throw `NullPointerException` when passed a null action if the subset was empty. These methods now throw `NullPointerException` when passed a null action for an empty subset instead of returning `false` or completing normally.