Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
8262841: Clarify the behavior of PhantomReference::refersTo
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, rriggs
  • Loading branch information
Mandy Chung committed Jun 30, 2021
1 parent aba6c55 commit 9ac63a6
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -43,6 +43,8 @@
* <p> In order to ensure that a reclaimable object remains so, the referent of
* a phantom reference may not be retrieved: The {@code get} method of a
* phantom reference always returns {@code null}.
* The {@link #refersTo(Object) refersTo} method can be used to test
* whether some object is the referent of a phantom reference.
*
* @author Mark Reinhold
* @since 1.2
Expand Down Expand Up @@ -75,9 +77,7 @@ public T get() {
* is registered with the given queue.
*
* <p> It is possible to create a phantom reference with a {@code null}
* queue, but such a reference is completely useless: Its {@code get}
* method will always return {@code null} and, since it does not have a queue,
* it will never be enqueued.
* queue. Such a reference will never be enqueued.
*
* @param referent the object the new phantom reference will refer to
* @param q the queue with which the reference is to be registered,
Expand Down

1 comment on commit 9ac63a6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.