On Mon, 24 Jan 2022 19:19:21 GMT, Alan Bateman <[email protected]> wrote:

>> Joe Darcy has updated the pull request with a new target base due to a merge 
>> or a rebase. The incremental webrev excludes the unrelated changes brought 
>> in by the merge/rebase. The pull request contains six additional commits 
>> since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8280168
>>  - Appease jcheck.
>>  - Add toIdentityString
>>  - Respond to review feedback to augment test.
>>  - Respond to review feedback.
>>  - JDK-8280168 Add Objects.toDefaultString
>
> src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line 
> 295:
> 
>> 293:         assert(isObjectMethod(m)) : m;
>> 294:         return switch (m.getName()) {
>> 295:             case "toString" -> java.util.Objects.toDefaultString(self);
> 
> It might be better if toString is changed to invoke toIdentityString(self), 
> only because hashCode returns the identity hash code, it doesn't invoke 
> hashCode().

Yes; that looks like an inconsistency/bug. Updated in a subsequent push.

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

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

Reply via email to