Hello all;

This is a fix to the Map.compute() default method and HashMap.compute() 
implementation to correct the handling of keys mapped to null values when the 
function returns null. This situation should result in the key being removed 
but it was not.

http://cr.openjdk.java.net/~mduigou/JDK-8017088/0/webrev/

I am strongly considering moving all of the current looping defaults in Map to 
ConcurrentMap and replacing them with implementations which throw 
ConcurrentModificationException rather than retrying. The current 
implementation of Map.compute() default comes close to breaking atomicity by 
adding the containsKey() check. (It doesn't because the subsequent remove() 
when oldValue = null can't succeed for any known ConcurrentMap implementations).

Mike

Reply via email to