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

Tagir F. Valeev tvaleev at openjdk.org
Wed Nov 8 17:29:06 UTC 2023


On Wed, 8 Nov 2023 17:17:21 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/stream/Gatherer.java line 330:
>> 
>>> 328:     static <T, R> Gatherer<T, Void, R> ofSequential(
>>> 329:             Integrator<Void, T, R> integrator,
>>> 330:             BiConsumer<Void, Downstream<? super R>> finisher) {
>> 
>> Probably, accepting `Consumer<Downstream<? super R>>` and adapting it would be more user-friendly?
>
> In that case the integrator should be a BiConsumer too, no ?

@forax I thought so initially, but this is not so easy, as there's a `Greedy` subinterface. If you adapt the `Integrator`, you will lose the ability to specify the greediness.

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

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


More information about the core-libs-dev mailing list