Round 1 feedback

Michael Nascimento misterm at gmail.com
Wed Feb 13 19:19:19 PST 2013


On Wed, Jan 9, 2013 at 2:13 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> What we did in 8 is add {Map,ConcurrentMap}.computeIfAbsent.  This
> eliminates 80% of the pain of simulating a multimap with a
> Map<K,Collection<V>>.  To wit:
>
> void add(K k, V v) {
>   map.computeIfAbsent(k, ArrayList::new).add(v);
> }

Going back to this one, this doesn't work as computeIfAbsent requires
a Function whose first argument is the key :-(

Is there any chance such conversions with method references are
possible, i.e., when their arity is less than the functional interface
method arity?

Regards,
Michael


More information about the lambda-dev mailing list