RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

Joe Darcy darcy at openjdk.org
Thu Jul 11 21:56:50 UTC 2024


On Thu, 11 Jul 2024 20:31:07 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> Bloch's _Effective Java, 3/e,_ Items 10, 11, and 12 have some useful background information on implementing equals, hashCode, and toString.

Agreed; I reread over those items before posting the PR.

The "typical" wording was meant to cover guidance like Bloch's "have equals throw an AssertionError if the method should never be called if it escapes its intended domain."

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

PR Comment: https://git.openjdk.org/jdk/pull/20128#issuecomment-2224008203


More information about the core-libs-dev mailing list