Review Request JDK-8175797: (ref) Reference::enqueue method should clear referent before enqueuing
Alan Bateman
Alan.Bateman at oracle.com
Wed Mar 8 14:52:53 UTC 2017
On 07/03/2017 15:35, Mandy Chung wrote:
> This proposes to update Reference::enqueue method to clear this reference
> object before enqueuing it to the registered queue consistent with what
> the garbage collector does that clears the reference object before putting
> it in the pending queue for enqueuing. It has been a common pattern that
> Reference::clear is called before or after enqueuing. I consider this
> a follow-up to JDK-8071507 that soft, weak, phantom references are
> automatically cleared references when implicitly or explicitly enqueued.
>
> Webrev at:
> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8175797/webrev.00/index.html
>
This looks okay to me, I'm just wondering if FinalReference::enqueue
should throw InternalError rather than UOE as it should never be called.
Also I'm wondering if the property should jdk.lang.ref.XXXX to be
consistent with other jdk.* properties.
-Alan
More information about the core-libs-dev
mailing list