RFR: 8029795 : LinkedHashMap.getOrDefault() doesn't update access order. (was Why doesn't new Map methods generate entry accesses on LinkedHashMap?)

Paul Sandoz paul.sandoz at oracle.com
Tue Dec 10 01:47:39 PST 2013


On Dec 10, 2013, at 5:37 AM, Mike Duigou <mike.duigou at oracle.com> wrote:

> Hello all;
> 
> I've posted a webrev for review which corrects the problem and adds appropriate tests.
> 
> http://cr.openjdk.java.net/~mduigou/JDK-8029795/0/webrev/
> 
> I also updated the documentation to mention that getOrDefault as well as the replace methods generate access events. 
> 

Looking good. I don't have a strong opinion on sharing code for this method.

We should probably also test the other methods computeIfAbsent, computeIfPresent, compute and merge.

Paul.


More information about the jdk8-dev mailing list