RFR: 8029795 : LinkedHashMap.getOrDefault() doesn't update access order. (was Why doesn't new Map methods generate entry accesses on LinkedHashMap?)
Mike Duigou
mike.duigou at oracle.com
Tue Dec 17 17:25:23 UTC 2013
Noted. Thank you.
Mike
On Dec 17 2013, at 05:51 , Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
> On Dec 17, 2013, at 4:42 AM, Mike Duigou <mike.duigou at oracle.com> wrote:
>
>> I've updated the documentation per Paul's suggestions. Specifically, in addition to the existing put() and get() methods the new Map methods
>>
>> putIfAbsent()
>> getOrDefault()
>> compute()
>> computeIfAbsent()
>> computeIfPresent()
>> merge()
>>
>> are all documented to perform a single access of the entry (assuming that an entry is created or modified as a result).
>>
>> replace()
>>
>> is documented as accessing the entry, if it exists and a replacement is made. If no replacement is made then no access is recorded.
>>
>> http://cr.openjdk.java.net/~mduigou/JDK-8029795/2/webrev/
>>
>
> Looking good. Just one v. minor thing for:
>
> + * invocation completes). The {@code replace} method only results in an access
> + * of the entry if the value is replaced. The {@code putAll} method generates one
>
> There are two replace methods:
>
> * invocation completes). The {@code replace} methods only results in an access
>
> Paul.
More information about the core-libs-dev
mailing list