JavaDoc fix in java.util.Date

Chen Liang chen.l.liang at oracle.com
Wed Apr 30 21:07:10 UTC 2025


Indeed, Archie is right. There are different levels of strictness in the specification.

In this particular site, we have "the hash code is the value of the expression" which only requires the return value to be equivalent. The implementation is free to be anything.

In specifications, we usually use "equivalent" to indicate behaviors are the same but implementation code may differ. The words "the same as", "idential to" or simply "is" indicate exact matches.

-Chen
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Archie Cobbs <archie.cobbs at gmail.com>
Sent: Wednesday, April 30, 2025 3:43 PM
To: Steffen Nießing <zuniquex at protonmail.com>
Cc: core-libs-dev at openjdk.org <core-libs-dev at openjdk.org>
Subject: Re: JavaDoc fix in java.util.Date

On Wed, Apr 30, 2025 at 3:38 PM Steffen Nießing <zuniquex at protonmail.com<mailto:zuniquex at protonmail.com>> wrote:
However, the docs should match the expression used in the implementation when explicitly naming the returned expression. Should we update both to Long.hashCode(this.getTime())?

I think that's a little too strong of a statement. Rather, if the docs describe the behavior using an expression or sample code, the actual behavior should be equivalent to that expression or sample code; the actual implementation can effect that result however it wants to, as long as the result is the same.

-Archie

--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250430/d7988a37/attachment.htm>


More information about the core-libs-dev mailing list