RFR: 8335637: Add explicit well-behaved expectations to Object.{toString, hashCode} [v2]
Alan Bateman
alanb at openjdk.org
Mon Jul 8 18:07:34 UTC 2024
On Mon, 8 Jul 2024 16:46:00 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> Make well-behaved implementation expectations of Object.{toString, hashCode} explicit.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Update wording.
Specifying that toString returns a non-null result is good. Specifying that the methods don't throw any exceptions, or an implSpec that the methods shouldn't throw is okay.
I'm less sure about the proposed wording for resource usage. For hashCode then maybe it should say that the hashCode method may be called very frequently and should be as fast and use as few resources as possible.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20063#issuecomment-2214849998
More information about the core-libs-dev
mailing list