On Mon, 23 May 2022 07:52:58 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java line >> 115: >> >>> 113: >>> 114: // find the thread container that corresponds to the >>> executor >>> 115: String name = Objects.toIdentityString(executor); >> >> I don't understand the need for `toIdentityString()` rather than just >> `toString()` > > The implementation lends on the string returned by Object::toString when not > overridden. In this case, either will do so I can change it to toString. Yeah, the fact that it's known not to be overridden makes it confusing that toIdentityString() is used. But if you feel this helps better document what the dumping implementation uses, it might be better to use toIdentityString(). It makes for accurate example code in that case. Either is ok (or maybe just a useful comment) ------------- PR: https://git.openjdk.java.net/jdk/pull/8784