RFR(m): JEP 269 initial API and skeleton implementation (JDK-8139232)

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue Nov 24 12:21:27 UTC 2015


Hi Stuart,

On 11/24/2015 09:26 AM, Stuart Marks wrote:
> Webrev:
> 
>     http://cr.openjdk.java.net/~smarks/reviews/jep269/webrev.20151123/

 * It is mildly puzzling why the HashMap initial capacity is different
from the number of elements you are about to push -- need to spell out
that we are adjusting for the default HashMap load factor?

 * HashMap would round up the capacity to the next power of two, which
means you can just either use the default capacity (16) in third of the
cases, and/or specialize for a step lower capacity (4/8) for smaller
methods? This saves load-factor-dependent computation.

 * Map.of(E... es). Is this a suggested strategy to deal with arrays?
Why not follow Guava's example with doing Map.of(E e1, .. E e11, E...
others) to avoid confusion with arrays? If there is a reason, I must
have overlooked it in JEP description and/or code comments.

Thanks,
-Aleksey




More information about the core-libs-dev mailing list