mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-25 09:40:10 +00:00
7166055: Javadoc for WeakHashMap contains misleading advice
Reviewed-by: dholmes, mduigou
This commit is contained in:
parent
59ccdc0fbc
commit
ad2bdf4faa
@ -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 <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>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user