United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6245166 (coll spec) TreeMap class documentation should use SortedMap instead of Map
JDK-6245166 : (coll spec) TreeMap class documentation should use SortedMap instead of Map

Details
Type:
Bug
Submit Date:
2005-03-23
Status:
Resolved
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2005-09-04
Component:
core-libs
OS:
windows_xp
Sub-Component:
java.util:collections
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

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
                                     
2005-03-24



Hardware and Software, Engineered to Work Together