RFR : 8016446 : (m) Add override forEach/replaceAll to HashMap, Hashtable, IdentityHashMap, WeakHashMap, TreeMap
Paul Sandoz
paul.sandoz at oracle.com
Wed Jun 19 10:49:12 UTC 2013
On Jun 19, 2013, at 11:53 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>> This is another little oddity in Map.forEach:
>>
>> try {
>> k = entry.getKey();
>> v = entry.getValue();
>> } catch(IllegalStateException ise) {
>> throw new ConcurrentModificationException(ise);
>> }
>>
>> I would presume the entries from CconcurrentMap.entrySet would not throw ISEs
>
> Does it worth to override forEach in ConcurrentMap for that ?
>
Dunno, i am struggling to work up a strong opinion :-) It seems wrong for ConcurrentMap impls but i just cannot see why any such impls would throw ISEs.
Paul.
More information about the core-libs-dev
mailing list