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

Tagir F. Valeev tvaleev at openjdk.org
Thu Nov 9 09:45:18 UTC 2023


On Wed, 8 Nov 2023 21:03:59 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/stream/Gatherer.java line 272:
>> 
>>> 270:      * Returns a combiner which is the default combiner of a Gatherer.
>>> 271:      * The returned combiner identifies that the owning Gatherer must only
>>> 272:      * be evaluated sequentially.
>> 
>> Should we specify that a single shared instance is guaranteed to be returned, so clients may use `combiner == defaultCombiner()`, rather than `combiner.equals(defaultCombiner())`?
>
> @amaembo Something to the effect of "This method always returns the same instance."?

@viktorklang-ora yes.

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

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


More information about the core-libs-dev mailing list