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

Peter Levart peter.levart at gmail.com
Wed Jun 19 10:48:57 UTC 2013

On 06/19/2013 11:45 AM, Paul Sandoz wrote:
> >>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.

But only in ConcurrentMap implementations that do override forEach (and 
don't override replaceAll). Can we expect that a ConcurrentMap 
implementations will override both or none in most cases? If it 
overrides both, then defaults don't matter, if it overrides none, then 
what we're left with is only "creation of a capturing BiConsumer lambda" 
overhead for no benefit.

Regards, Peter

More information about the core-libs-dev mailing list