JDK-6201870 : (coll) Deprecate Vector and Hashtable
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-11-30
  • Updated: 2016-04-20
  • Resolved: 2005-08-10
Related Reports
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
Deprecate Vector and Hashtable and javadoc them to direct developers to use ArrayList (or another List implementation) and HashMap (and to use Collection.synchronizedList & Collection.synchronizedMap where necessary).

JUSTIFICATION :
It is preferred by most developers that ArrayList is used in preference to Vector, and that HashMap is used in preference to Hashtable.
The main reason developers have this preference is because of speed.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The older collection objects cease to be used.

Comments
EVALUATION Of course, the JDK introduced the Collections Framework in 1.2, and the new classes are in some sense to be preferred to the older collection classes. However: - the older classes have been retrofitted so that they too implement the same interfaces as the newer classes. - the older classes are still maintained, and work just fine. This isn't Thread.destroy. - Sometimes, the synchronized behavior of Vector is just what you want. Why not use it? - When writing a portable little program, why not target JDK 1.0.2 ? Not everyone has upgraded their JDK when it "works perfectly well". - These classes are so popular that they can never be removed. Deprecation is futile. Gentle denigration, on the other hand...
2005-08-10