RFR: 8372946 - TreeMap sub-map entry spliterator is expensive [v4]

Oli Gillespie ogillespie at openjdk.org
Mon Feb 23 16:45:19 UTC 2026


On Mon, 23 Feb 2026 15:32:25 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Yes, seems you cannot create a spliterator with a lazy iterator. This is fine.
>
> Alternatively we can override `stream()` to call the `StreamSupport.stream` that takes a `Supplier<? extends Spliterator<T>>` instead.

Good point, in fact I think that's more correct. From stream():

> This method should be overridden when the spliterator() method cannot return a spliterator that is IMMUTABLE, CONCURRENT, or late-binding. (See spliterator() for details.)

I suppose ours is no longer late-binding.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28608#discussion_r2841881785


More information about the core-libs-dev mailing list