ConcurrentHashMap/ConcurrentMap/Map.compute (original) (raw)
Doug Lea dl at cs.oswego.edu
Thu Dec 6 13:10:36 PST 2012
- Previous message: ConcurrentHashMap/ConcurrentMap/Map.compute
- Next message: Remove cumulate from Stream interface
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/06/12 07:29, Doug Lea wrote:
Actually, it would be a ConcurrentMap spec change, which is definitely crossing the line. It will take some further thought to see if there is a spec/wording that is both safe and useful.
Not so hard. All of the "The default implementation is equivalent to:" specs and wordings are now completely compatible with those in ConcurrentMap (which could use a few tiny touchups someday to clarify this).
This omits the what would have been a nice symmetry about replace(k, null) and computeIfPresent. The only interpretation that works is for replace in non-null-accepting maps to throw NPE here. Which is what the j.u.c Maps now do anyway.
I put a viewable version of the javadocs (using JDK7 javadoc) at http://gee.cs.oswego.edu/dl/wwwtmp/apis/Map.html (With nested standin versions of Function interfaces decls for now.) Comments welcome.
I suspect that the style/terminology here of documenting defaults by saying they are equivalent to code snippets will usually be the most informative/useful tactic. It seems to be more understandable than the AbstractCollection etc style of trying to say it all in words.
-Doug
- Previous message: ConcurrentHashMap/ConcurrentMap/Map.compute
- Next message: Remove cumulate from Stream interface
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list