RFR: 8279361: Error in documentation of third Stream.reduce method
Tagir F. Valeev
tvaleev at openjdk.org
Thu Sep 29 06:59:17 UTC 2022
On Wed, 28 Sep 2022 15:36:50 GMT, Viktor Klang (Oracle) <duke at openjdk.org> wrote:
> This JavaDoc change attempts to shine some light on the `combiner`-function as it relates to the third variant of `Stream.reduce` since it according to the bug submission in JBS can be confusing that the `combiner` is not mentioned in the code example in the documentation.
Note that similar code is written in other places. E.g.
java.util.stream.Stream#collect(supplier, accumulator, combiner) -- combiner is not mentioned
R result = supplier.get();
for (T element : this stream)
accumulator.accept(result, element);
return result;
The same for IntStream, LongStream, and DoubleStream.collect.
In fact, I'm not sure that this worth fixing.
-------------
PR: https://git.openjdk.org/jdk/pull/10469
More information about the core-libs-dev
mailing list