RFR: 8289389: Fix warnings: type should also implement hashCode() since it overrides Object.equals() [v5]

Kevin Rushforth kcr at openjdk.org
Fri Jul 22 17:41:24 UTC 2022


On Fri, 22 Jul 2022 17:05:06 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> - added missing hashCode() methods
>
> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8289389: review comments

The changes look good.

I note that by initializing the hash to `CLASSNAME.class.hashCode()`, instead of a constant, the hash code produced will not be predictable or stable across different invocations of the JVM. This is entirely permissible by the spec of `Object.hashCode()`, so it is just a (somewhat) interesting note.

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

Marked as reviewed by kcr (Lead).

PR: https://git.openjdk.org/jfx/pull/821


More information about the openjfx-dev mailing list