JDK-6245166 : (coll spec) TreeMap class documentation should use SortedMap instead of Map
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-03-23
  • Updated: 2012-10-08
  • Resolved: 2005-09-04
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 6
6 b51Fixed
Description
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeMap.html

A DESCRIPTION OF THE PROBLEM :
While talking about synchronized access to TreeMap, the following typo is found:

Map m = Collections.synchronizedMap(new TreeMap(...));

which should instead read:

SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));
ACTUAL -
Map m = Collections.synchronizedMap(new TreeMap(...));
###@###.### 2005-03-23 22:32:34 GMT

Comments
EVALUATION Agreed. Perhaps we will want Collections.synchronizedNavigableMap for jsr166x changes? ###@###.### 2005-03-24 02:37:27 GMT
24-03-2005