JDK-8031133 : AbstractMap should specify its default implementation using @implSpec
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 8
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-01-02
  • Updated: 2024-07-31
  • Resolved: 2014-01-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8Fixed 9 b01Fixed
Related Reports
Relates :  
Relates :  
Description
see discussion on core-libs-dev mailing list:
   http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-December/024163.html
 
--- snippet ---
There might have been some mis-communication about whether the
new @implSpec tag would be used in existing java.util.AbstractX
classes. I had assumed that it would be, and pulled out a few
javadoc overrides in java.util.concurrent classes that would
not be needed if @implSpec were used. With @implSpec, you do
not need to paste in the interface-level spec in an overridden
method just to suppress inclusion of (incorrect) doc comments
about the default implementation.

Is it too late to do this for JDK8? It is easy -- just add a line
with @implSpec for each defined method. AbstractMap diffs
below. (They could be tweaked to get rid of now-unnecessary
paragraph markup, but I don't think this would improve display.)
...
--- snippet ---
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/18080cca998a User: lana Date: 2014-01-15 02:08:46 +0000
15-01-2014

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/18080cca998a User: chegar Date: 2014-01-03 06:51:27 +0000
03-01-2014

Looks like Sandeep's edit has removed the 8-critical-approved label. I've just restored it.
02-01-2014

Release team: Approved for fixing
02-01-2014

Rationale for 8-critical-request: This issue causes a specification bug in the ConcurrentHashMap API. Both the size() and isEmpty() methods define incorrect, sub-performant, implementations. Risk: minimal. The proposed changes affect documentation only. No behaviour or implementation changes. This bug cannot be fixed in an update release, as it requires a specification change ( which cannot be done in an update release ). It is worth noting that if this bug is not fixed, it will likely lead to JCK issues, and potential challenges from Licensees.
02-01-2014

I agree with Doug's changes to AbstractMap. I’ve taken the patch, removed the superfluous paragraph tags, and generated a webrev. http://cr.openjdk.java.net/~chegar/AbstractMap_implSpec/webrev/ I also ran specdiff to see what else may be impacted by this. It shows that the only spec changes are to AbstractMap itself, and to ConcurrentHashMap size and isEmpty. What we want. http://cr.openjdk.java.net/~chegar/AbstractMap_implSpec/specdiff/overview-summary.html I know it is late in the JDK 8 game, but I see this as a serious bug in the documentation, and it needs to be addressed. Given the above specdiff, I would be confident to request this change for inclusion in JDK 8.
02-01-2014