RFR: 8238684: Override getOrDefault in immutable Map implementations

Claes Redestad claes.redestad at oracle.com
Fri Feb 7 14:30:49 UTC 2020


Hi Rémi,

On 2020-02-07 15:21, Remi Forax wrote:
> Hi Claes,
> looks good,

thanks!

> it can be written in a less Doug Lea-ish way like this
> 
>    V v = get(key);
>    return (v != null)? v: default;
> 
> I believe it using the same number of bytecodes :)
> with a ALOAD instead of a DUP

yes, but I have no strong preference. It did feel reasonable to keep it
in the same style as the implementation I override.

/Claes


More information about the core-libs-dev mailing list