RFR: 8015318: Extend Collector with 'finish' operation

Arne Siegel v.a.ammodytes at googlemail.com
Mon Jul 8 02:19:47 PDT 2013


Hi,

when reading the sources, I gut puzzled about 3 lines in ReduceOps.java:
 150      * @param <T> the type of the input elements
 151      * @param <I> the type of the intermediate reduction result
 152      * @param <I> the type of the final reduction result

My first thought was that the third of these three lines should be changed
from <I> to <R>.

Looking further, I got the impression that R could be eliminated altogether
as it is used nowhere inside of makeRef.

Looking even deeper, I'm wondering if makeRef shouldn't consider the
finisher method of Collector, maybe in the get method in the ReduceOp.

Arne Siegel


2013/7/6 Henry Jen <henry.jen at oracle.com>

> Hi,
>
> Please review the webrev at
> http://cr.openjdk.java.net/~henryjen/ccc/8015318.0/webrev/
>
> This webrev refactor java.util.Collector interface to allow an
> intermediate type used for accumulation and then produce final result
> type with a 'finished' function.
>
> Collectors are updated to reflect the changes, and quite a few API changes,
>
> toStringJoiner -> joining
> Return type becoming Optional<T> when appropriate
> sumBy -> a set of summing[Int,Long,Double]
> average[Int,Long,Double]
>
> I'll put specdiff up later for those interested in API changes.
>
> Cheers,
> Henry
>
>


More information about the lambda-dev mailing list