On Feb 5, 2015, at 1:36 AM, Brent Christian <brent.christ...@oracle.com> wrote:
> I prefer this approach of discouraging/preventing side-effects via CME, 
> rather than allowing them.  Keep the functions "functional", as it were.
> 
> If there are situations where determining the mapping for one key 
> necessitates making additional changes to the Map, that should be coded some 
> other way.  IMO, sneaking extra work into computeIfAbsent() is too big a 
> departure from how the method is intended to be used.
> 
> Regarding the default methods:
> 
> Would we be able to make a "best-effort" detection of comodification by 
> checking for a change in size before and after calling mappingFunction?  Or 
> are there other reasons we "cannot do anything" about the default methods?
> 

Yes, i suppose we could, of course it would not detect any aliasing when 
sampling the size.

My inclination is to leave these as is and focus on the most common concrete 
implementations.

Paul.

Reply via email to