Re: Stream Gatherers (JEP 473) feedback

2024-09-23 Thread Anthony Vanelverdinghe
> > The ability for developers to implement interfaces (knowingly or unknowingly)  > in non-spec-conforming ways aside, are you suggesting that we add a section > in the Gatherer (and Collector) in the form of "Implementor Notes" that are a > bit more high-level than the speci

Re: Stream Gatherers (JEP 473) feedback

2024-09-19 Thread Anthony Vanelverdinghe
single-use, Collector does not explain why they are reusable, why would > Gatherers be held to a different standard? > > > "protecting the users from being given non-reusable Gatherers" > Think of it more like increasing the odds that users are given > spec-conformant Gatherers. > &g

Re: Stream Gatherers (JEP 473) feedback

2024-09-18 Thread Anthony Vanelverdinghe
Hi Viktor Let me start with a question: is the requirement (a) "a Gatherer SHOULD be reusable", or (b) "a Gatherer MUST be reusable"? As of today the specification says (b), whereas the implementation matches (a). In case of (a), I propose to align the specification to allow for compliant, non-

Re: Stream Gatherers (JEP 473) feedback

2024-09-12 Thread Anthony Vanelverdinghe
Anthony > Cheers, > > √ > > **Viktor Klang** > Software Architect, Java Platform Group > > Oracle > > > > **From:** Anthony Vanelverdinghe > **Sent:** Saturday, 7 September 2024 21:03 > **To:** Viktor Klang ; core-libs-dev@openjdk.org > > **Subjec

Re: [External] : Re: Stream Gatherers (JEP 473) feedback

2024-09-07 Thread Anthony Vanelverdinghe
(d::push) >    ...>         ); >    ...>     } > |  created method concat(Supplier>) > > jshell> var **inject** = concat(() -> Stream.of(1,2)) > inject ==> GathererImpl[initializer=DEFAULT, integrator=$Lam ... > 1c0d9c70@1a052a00] > > jsh

Re: [External] : Re: Stream Gatherers (JEP 473) feedback

2024-08-19 Thread Anthony Vanelverdinghe
7;t exposed to user code. I'll keep this in mind for any upcoming > maintenance 👍 > > Keep the feedback coming 🙂 > > Cheers, > > √ Kind regards, Anthony > **Viktor Klang** > Software Architect, Java Platform Group > > Oracle > >

Re: Stream Gatherers (JEP 473) feedback

2024-08-13 Thread Anthony Vanelverdinghe
ns to inference, you can see usage examples in > the implementation of Gatherers which does need some assistance to > inference:https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/stream/Gatherers.java > > Cheers, > > √ > > **Viktor Klang**

Re: Stream Gatherers (JEP 473) feedback

2024-07-30 Thread Anthony Vanelverdinghe
nference or is it possible that some generic type bounds aren't as generic as they could be, prohibiting type inference in certain cases? > Cheers, > > √ > > **Viktor Klang** > Software Architect, Java Platform Group > > Oracle Kind regards, Anthony > > >

Stream Gatherers (JEP 473) feedback

2024-07-26 Thread Anthony Vanelverdinghe
When writing factory methods for Gatherers, there's sometimes a degenerate case that requires returning a no-op Gatherer. So I'd like a way to mark a no-op Gatherer as such, allowing the Stream implementation to recognize and eliminate it from the pipeline. One idea is to add Gatherer.defaultIn