On Mon, 9 Aug 2021 20:15:59 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/ref/Reference.java line 374:
>> 
>>> 372:      * to call the native implementation over the intrinsic.
>>> 373:      */
>>> 374:     boolean refersToImpl(T obj) {
>> 
>> I'm curious why can't you get rid of `refersToImpl` (virtual method) and 
>> just override `refersTo` on `PhantomReference`. Am I missing something 
>> important about keeping `refersTo` final?
>
> We don't want user-defined subclass of `Reference` overriding the `refersTo` 
> implementation accidentally.

Got it. Thanks for the clarification!

-------------

PR: https://git.openjdk.java.net/jdk/pull/5052

Reply via email to