OpenJDK / bsd-port / bsd-port / jdk
changeset 6188:63a844e1449f
7166055: Javadoc for WeakHashMap contains misleading advice
Reviewed-by: dholmes, mduigou, darcy
author | littlee |
---|---|
date | Mon, 04 Jun 2012 16:30:35 +0800 |
parents | 753533a351ba |
children | 0d904c4373d1 |
files | src/share/classes/java/util/WeakHashMap.java |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/java/util/WeakHashMap.java Tue Oct 16 17:17:45 2012 +0400 +++ b/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>,