On Wed, 14 Oct 2020 11:18:18 GMT, Albert Mingkun Yang <ay...@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