Poor Javadoc of Map default methods [Re: RFR: 8029055: Map.merge must refuse null values]
scolebourne at joda.org
Wed Nov 27 15:11:53 UTC 2013
On 26 November 2013 17:35, Martin Buchholz <martinrb at google.com> wrote:
> I haven't looked in depth, but I agree with Stephen's analysis. This API
> and its javadoc needs work.
> E.g. It's not clear that the purpose of Map.compute is to *update* the
> mapping for key in the map.
I actually felt that the names of all four methods felt wrong. compute
and merge seem like unfortunate choices.
> Instead of "The default implementation makes no guarantees about
> synchronization or atomicity properties of this method." we should boldly
> say that the default implementation is *not* atomic, even if the underlying
> map is.
Saying that the default implementation is not atomic sounds uncontroversial.
More information about the core-libs-dev