Round 2 feedback

Michael Nascimento misterm at
Sat Feb 9 16:34:05 PST 2013

Hi guys,

So I've updated my code to b76. Some unstructured feedback:

- We use many Maps here, with many transformations. It is still painful to
do operations like transformValues, because it usually involves using other
lambdas and then type inference fails, still requiring specificying the
actual type parameters - and this might require many parameters sometimes;
- At least here, even simple transformations such as
requires the explicit types;
- groupingBy that returns a Map keyed by the Stream type is completely
unintuitive. If not by the suggestion from the mailing list, I would never
think of it as being applicable to my use case. A better name is certainly
- It seems odd to have collect and collectUnordered when some Collectors
are naturally unordered, such as toSet. Can't it be changed to be a
property of the Collector somehow?;
- computeIfAbsent is useful, but for most Guava cases I wanted to lambdify
I actually needed a method that returns an Optional instead. Can it be
- Here is my greatest concern so far: parallel streams in their current
form will cause Java EE applications to fail miserably. In such
environments, threads cannot be freely created and all types of leaks and
exceptions can happen if one calls a method in a non-container managed
thread. Since calling parallelStream is cheap, I guess people will do it
often and it will be hard for Java EE developers to find out if any
third-party Java SE 8 code is safe to call or not - and enterprise
developers unaware of such restrictions, which are unfortunately the
majority, will be puzzled by never seen exceptions or erratic behaviour in
production. My suggestion would be to add a parameter to parallelStream and
parallel which is an abstraction to thread management,  forcing people to
think about it. Then one can construct a wrapper over the
container-specific API for now and Java EE 8 can provide the standardized
- Some throw-away Javadoc could be added, especially to Collectors, only
with sample code for a Person class so developers can understand what
methods are supposed to do.

I would like to congratulate you all for the fast responses.


More information about the lambda-dev mailing list