On Thu, 29 Jan 2026 12:40:42 GMT, Oli Gillespie <[email protected]> wrote:
> Add missing cases to SpliteratorTraversingAndSplittingTest. This came up when > I was fixing https://bugs.openjdk.org/browse/JDK-8372946, and I noticed the > tests do not cover these sub-maps. > > Two interesting parts: > > 1. These tests failed when first added because `SubMapKeyIterator` and > `DescendingSubMapKeyIterator` do not eagerly throw `NullPointerException` for > `null` action arguments. The spec says "Throws: NullPointerException - if the > specified action is null", so I updated the implementation to match other > spliterators. > 2. Since the descending maps have the reverse expected iteration order, I > added support in the test harness for descending maps. The code change looks fine to me. Let another core library engineer double check. Note this patch requires a release note according to the CSR: some calls like `new TreeSet<Integer>().subSet(-1, 1).stream().forEach(null);` now throws NPE instead of completing normally. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29485#pullrequestreview-3823568148
