RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

Viktor Klang vklang at openjdk.org
Fri Nov 10 22:10:18 UTC 2023


On Fri, 10 Nov 2023 16:25:44 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Viktor Klang has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Multiple improvements to Gatherer and Gatherers javadoc and restructuring of Gatherers.java to put public at the top of the file.
>>  - Augmenting Gatherer tests to include default implementation in Stream
>
> src/java.base/share/classes/java/util/stream/Gatherer.java line 479:
> 
>> 477:          *
>> 478:          * <p>If this method returns {@code false} then the next stage does
>> 479:          * not accept any more elements.
> 
> So once push returns false then any further attempts to push to this downstream will also return false.

Yeah, perhaps should read something like:

`If this method returns {@code false} then no further elements need to be pushed, and subsequent pushes will also return {@code false}.` ? (And make it an implSpec?)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1389969005


More information about the core-libs-dev mailing list