Extending Collector to handle a post-transform

Brian Goetz brian.goetz at oracle.com
Tue Jun 11 17:28:27 PDT 2013


> The idea behind SimpleCollector is not to hide Collector, but to offer a
> simple abstraction for the case where the full blown Collector is not
> needed,
> like Executor/ExecutorService.
> I don't think you need a wildcard if you overload Stream.collect.

Again, that has a pretty big cost.  Not only do you have to overload 
collect, but you have to overload *all* the collector combinators like 
groupingBy.  We did an awful lot of work to make groupingBy smaller and 
more accessible; taking a 2x explosion for the sake of badly papering 
over this issue is a loser.

So, let's take a step back.  Before we go all the way around the world 
to "solve" this problem, I would like to (a) be convinced we have a 
problem and (b) understand better what the problem is.  So far, I'm not 
really seeing how the current API is so terrible (and, having already 
considered all the things suggested so far and more, it seems most cures 
are worse than the disease, whatever that disease actually is.)


More information about the lambda-libs-spec-experts mailing list