7166055: Javadoc for WeakHashMap contains misleading advice
authorlittlee
Mon, 04 Jun 2012 16:30:35 +0800
changeset 12864 c404d4a709de
parent 12863 77e41e310650
child 12865 d197a6781b1f
7166055: Javadoc for WeakHashMap contains misleading advice Reviewed-by: dholmes, mduigou
jdk/src/share/classes/java/util/WeakHashMap.java
--- a/jdk/src/share/classes/java/util/WeakHashMap.java	Fri Jun 01 00:05:21 2012 -0700
+++ b/jdk/src/share/classes/java/util/WeakHashMap.java	Mon Jun 04 16:30:35 2012 +0800
@@ -90,7 +90,8 @@
  * from being discarded.  Note that a value object may refer indirectly to its
  * key via the <tt>WeakHashMap</tt> 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
  * <tt>WeakReferences</tt> before
  * inserting, as in: <tt>m.put(key, new WeakReference(value))</tt>,