United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6201870 : (coll) Deprecate Vector and Hashtable

Details
Type:
Enhancement
Submit Date:
2004-11-30
Status:
Closed
Updated Date:
2016-04-20
Project Name:
JDK
Resolved Date:
2005-08-10
Component:
core-libs
OS:
windows_xp
Sub-Component:
java.util:collections
CPU:
x86
Priority:
P4
Resolution:
Not an Issue
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

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



Hardware and Software, Engineered to Work Together