Integrated: 8376698: Add Spliterator tests for TreeMap sub-maps

Oli Gillespie ogillespie at openjdk.org
Fri Feb 20 16:52:52 UTC 2026


On Thu, 29 Jan 2026 12:40:42 GMT, Oli Gillespie <ogillespie at openjdk.org> 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.

This pull request has now been integrated.

Changeset: 932f28c6
Author:    Oli Gillespie <ogillespie at openjdk.org>
Committer: Chen Liang <liach at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/932f28c69b8573ad85fde2e0fa00cb3a46d93c2e
Stats:     32 lines in 2 files changed: 29 ins; 1 del; 2 mod

8376698: Add Spliterator tests for TreeMap sub-maps

Reviewed-by: liach, rriggs

-------------

PR: https://git.openjdk.org/jdk/pull/29485


More information about the core-libs-dev mailing list