RFR: JDK-8280168 Add Objects.toDefaultString [v3]

Joe Darcy darcy at openjdk.java.net
Wed Jan 19 18:48:48 UTC 2022


> While it is strongly recommend to not use the default toString for a class, at times it is the least-bad alternative. When that alternative needs to be used, it would be helpful to have the implementation already available, such as in Objects.toDefaultString(). This method is analagous to System.identityHashCode.
> 
> Please also review the CSR: https://bugs.openjdk.java.net/browse/JDK-8280184

Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:

  Respond to review feedback to augment test.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7139/files
  - new: https://git.openjdk.java.net/jdk/pull/7139/files/6ea4de5a..a854766b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7139&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7139&range=01-02

  Stats: 10 lines in 1 file changed: 10 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7139.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7139/head:pull/7139

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


More information about the core-libs-dev mailing list