From ad2bdf4faaf261ffdedc34636ff5ff2df86bc09b Mon Sep 17 00:00:00 2001 From: Charles Lee Date: Mon, 4 Jun 2012 16:30:35 +0800 Subject: [PATCH] 7166055: Javadoc for WeakHashMap contains misleading advice Reviewed-by: dholmes, mduigou --- jdk/src/share/classes/java/util/WeakHashMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/util/WeakHashMap.java b/jdk/src/share/classes/java/util/WeakHashMap.java index aad6fbe5101..ed9e1ad9396 100644 --- a/jdk/src/share/classes/java/util/WeakHashMap.java +++ b/jdk/src/share/classes/java/util/WeakHashMap.java @@ -90,7 +90,8 @@ import java.lang.ref.ReferenceQueue; * from being discarded. Note that a value object may refer indirectly to its * key via the WeakHashMap itself; that is, a value object may * strongly refer to some other key object whose associated value object, in - * turn, strongly refers to the key of the first value object. One way + * turn, strongly refers to the key of the first value object. If the values + * in the map do not rely on the map holding strong references to them, one way * to deal with this is to wrap values themselves within * WeakReferences before * inserting, as in: m.put(key, new WeakReference(value)),