From 95c7559bd3dc7a1f11fcf1986a6b2cbc1714e670 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Mon, 10 Mar 2008 23:23:48 -0700 Subject: [PATCH] 6583872: (coll) Direct uninformed users away from Vector/Hashtable Reviewed-by: dholmes --- jdk/src/share/classes/java/util/Hashtable.java | 12 +++++++++--- jdk/src/share/classes/java/util/Vector.java | 10 +++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/classes/java/util/Hashtable.java b/jdk/src/share/classes/java/util/Hashtable.java index a91a01226fa..c19a6ad249a 100644 --- a/jdk/src/share/classes/java/util/Hashtable.java +++ b/jdk/src/share/classes/java/util/Hashtable.java @@ -100,9 +100,15 @@ import java.io.*; * *

As of the Java 2 platform v1.2, this class was retrofitted to * implement the {@link Map} interface, making it a member of the - * Java - * Collections Framework. Unlike the new collection - * implementations, {@code Hashtable} is synchronized. + * + * + * Java Collections Framework. Unlike the new collection + * implementations, {@code Hashtable} is synchronized. If a + * thread-safe implementation is not needed, it is recommended to use + * {@link HashMap} in place of {@code Hashtable}. If a thread-safe + * highly-concurrent implementation is desired, then it is recommended + * to use {@link java.util.concurrent.ConcurrentHashMap} in place of + * {@code Hashtable}. * * @author Arthur van Hoff * @author Josh Bloch diff --git a/jdk/src/share/classes/java/util/Vector.java b/jdk/src/share/classes/java/util/Vector.java index 209371c538d..ce5a2982fc2 100644 --- a/jdk/src/share/classes/java/util/Vector.java +++ b/jdk/src/share/classes/java/util/Vector.java @@ -64,15 +64,15 @@ package java.util; * *

As of the Java 2 platform v1.2, this class was retrofitted to * implement the {@link List} interface, making it a member of the - * Java - * Collections Framework. Unlike the new collection - * implementations, {@code Vector} is synchronized. + * + * Java Collections Framework. Unlike the new collection + * implementations, {@code Vector} is synchronized. If a thread-safe + * implementation is not needed, it is recommended to use {@link + * ArrayList} in place of {@code Vector}. * * @author Lee Boynton * @author Jonathan Payne * @see Collection - * @see List - * @see ArrayList * @see LinkedList * @since JDK1.0 */