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

Rémi Forax forax at openjdk.org
Wed Nov 8 17:29:03 UTC 2023


On Wed, 8 Nov 2023 15:17:57 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> It's still possible to have a situation where PECS signature could be useful, and I don't see any downsides. A user may want to reuse the same static integrator instead of creating several identical lambdas just because the target type is more specific. Sometimes, people complain later, and you'll have to fix this. For example, see that `Stream.generate()` [was fixed separately](https://bugs.openjdk.org/browse/JDK-8132097). So why not doing this from the very beginning?
>
> @amaembo In this case, given that it is intended as Preview, I think it makes sense to receive some user feedback on this. Note that Collector has been without PECS for Collector.of since 1.8: [of](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collector.html#of-java.util.function.Supplier-java.util.function.BiConsumer-java.util.function.BinaryOperator-java.util.function.Function-java.util.stream.Collector.Characteristics...-)
> 
> Right now I don't want to deviate from the Collector-heritage until there's more usage feedback, and I'm definitely not ruling out that PECS:ing the factories might be worth it.

I don't see the point of waiting here. Usually requests for PECSing signatures always comes two or three years after the API is realing when people starts to use the API in anger so the preview time is likely not enough.

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

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


More information about the core-libs-dev mailing list