< prev index next >

src/java.base/share/classes/java/lang/ref/package-info.java

Print this page
rev 13310 : imported patch inc1

@@ -61,13 +61,13 @@
  * A program may request to be notified of changes in an object's
  * reachability by <em>registering</em> an appropriate reference
  * object with a <em>reference queue</em> at the time the reference
  * object is created.  Some time after the garbage collector
  * determines that the reachability of the referent has changed to the
- * value corresponding to the type of the reference, it will add the
- * reference to the associated queue.  At this point, the reference is
- * considered to be <em>enqueued</em>.  The program may remove
+ * value corresponding to the type of the reference, it will clear the
+ * reference and add it to the associated queue.  At this point, the
+ * reference is considered to be <em>enqueued</em>.  The program may remove
  * references from a queue either by polling or by blocking until a
  * reference becomes available.  Reference queues are implemented by
  * the {@link java.lang.ref.ReferenceQueue} class.
  *
  * <p> The relationship between a registered reference object and its

@@ -89,18 +89,10 @@
  * the {@link java.lang.ref.ReferenceQueue#poll
  * ReferenceQueue.poll} method simply checks an internal data
  * structure, this check will add little overhead to the hashtable
  * access methods.
  *
- * <h3>Automatically-cleared references</h3>
- *
- * Soft and weak references are automatically cleared by the collector
- * before being added to the queues with which they are registered, if any,
- * hence they need not be registered with a queue in order to be useful.
- * Phantom references, by contrast, do not allow their referents to be
- * retrieved, so they must be registered with a queue.
- *
  * <a name="reachability"></a>
  * <h3>Reachability</h3>
  *
  * Going from strongest to weakest, the different levels of
  * reachability reflect the life cycle of an object.  They are
< prev index next >