-
Enhancement
-
Resolution: Fixed
-
P4
-
5.0
-
b55
-
x86
-
linux
A DESCRIPTION OF THE PROBLEM :
Classes of the collections API have been turned to generic classes, but the class documentation is not updated.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
That should now become
This example creates a hashtable of numbers. It uses the names of the numbers as keys:
Hashtable<String, Integer> numbers = new Hashtable<String, Integer>();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
Or, with automatic wrapping, even new Integer(1) can be replaced by 1.
ACTUAL -
E.g. in Hashtable, it says
This example creates a hashtable of numbers. It uses the names of the numbers as keys:
Hashtable numbers = new Hashtable();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Hashtable.html (amongst others)
Classes of the collections API have been turned to generic classes, but the class documentation is not updated.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
That should now become
This example creates a hashtable of numbers. It uses the names of the numbers as keys:
Hashtable<String, Integer> numbers = new Hashtable<String, Integer>();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
Or, with automatic wrapping, even new Integer(1) can be replaced by 1.
ACTUAL -
E.g. in Hashtable, it says
This example creates a hashtable of numbers. It uses the names of the numbers as keys:
Hashtable numbers = new Hashtable();
numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));
numbers.put("three", new Integer(3));
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Hashtable.html (amongst others)