On Dec 12, 2013, at 6:24 AM, Mike Duigou <mike.dui...@oracle.com> wrote:

> Hello all;
> 
> In the review for JDK-8029795 Paul Sandoz noted that HashMap.computeIfAbsent 
> would generate a spurious access event for keys mapped to null when the 
> function returned null. This patch corrects that behaviour.
> 
> http://cr.openjdk.java.net/~mduigou/JDK-8030016/0/webrev/
> 
> The actual regression test is LinkedHashMap/ComputeIfAbsentAccessOrder.java 
> whereas the changes to Map/Defaults are improvements to the existing tests 
> suggested by this bug (though they would not detect it).
> 

Looks OK to me.

I believe that fits better within the strange world of an existing entry 
considered absent if its value is null i.e. no side-effects if the entry is 
absent and mapping function returns null.

Paul.

Reply via email to