RFR : 8016446 : (m) Add override forEach/replaceAll to HashMap, Hashtable, IdentityHashMap, WeakHashMap, TreeMap

Mike Duigou mike.duigou at oracle.com
Tue Jun 18 23:13:25 UTC 2013


On Jun 18 2013, at 05:19 , Doug Lea wrote:

> On 06/17/13 19:30, Mike Duigou wrote:
> 
>> 
>> I had to add the improved default for ConcurrentMap which was present in the lambda repo in order to have correct behaviour. Since getOrDefault is already in ConcurrentMap I will include this but we have to be careful when we do a jsr 166 syncup to make sure that the defaults don't get lost.
>> 
> 
> Now synched up on my side.
> 
> -Doug
> 



Per a suggestion from Remi I updated the ConcurrentMap.replaceAll default to use forEach. This trades off the entrySet iterator overhead for creation of a capturing BiConsumer lambda.

http://hg.openjdk.java.net/jdk8/tl/jdk/raw-diff/1f7cbe4829fe/src/share/classes/java/util/concurrent/ConcurrentMap.java

Mike


More information about the core-libs-dev mailing list