RFR: 8188055: (ref) Add Reference::refersTo predicate [v3]
Kim Barrett
kbarrett at openjdk.java.net
Wed Oct 14 14:24:14 UTC 2020
On Wed, 14 Oct 2020 11:18:18 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Kim Barrett has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - simplify test
>> - cleanup nits from Mandy
>> - use Object instead of TestObject
>
> src/java.base/share/classes/java/lang/ref/Reference.java line 362:
>
>> 360: /* Implementation of refersTo() for non-phantom references.
>> 361: */
>> 362: native boolean refersTo0(Object o);
>
> 1. Why is it named `refersTo0`? How about sth more descriptive, e.g.`refersToNative`?
> 2. Nit: including some text that this method is overridden in `PhantomReference.java` in the comments will be more
> informative and helpful; otherwise, one might be wondering how non-phantom and phantom refs are distinguished here.
(1) The "0" suffix is idiomatic for this sort of thing. See, for example,
src/java.base/share/native/libjava/ConstantPool.c. (2) I'm not sure what else besides an override one might wonder
about? "Default implementation of refersTo(), for non-phantom references."?
-------------
PR: https://git.openjdk.java.net/jdk/pull/498
More information about the core-libs-dev
mailing list