RFR: 8357647 : Stream gatherers forward upstream size information to downstream

Chen Liang liach at openjdk.org
Fri May 23 15:35:51 UTC 2025


On Fri, 23 May 2025 15:15:30 GMT, Viktor Klang <vklang at openjdk.org> wrote:

> While it could be argued that unbounded Spliterators should not report SIZED / SUBSIZED, GatherSink should report an unknown emission size, so switching to downstream.begin(-1) rather than downstream.begin(size).
> 
> Includes a regression test which yields an OOME if this change is omitted.

Looks sensible; an integrator may push an arbitrary number of items to the downstream.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25418#pullrequestreview-2864843391


More information about the core-libs-dev mailing list