[records] updates for Preview 9. hashCode

Daniel Heidinga Daniel_Heidinga at ca.ibm.com
Wed Jan 15 03:52:58 UTC 2020

>OK, so I’ve updated the proposed doc change along those lines.
>  http://cr.openjdk.java.net/~jrose/draft/record-contract
>(Previous versions are …/record-contract.{00,01}.)
>I adapted the javadoc from AbstractMap::toString, and
>then added some sample code, just for grins.  It would be
>fine to delete the sample code.
>     * @implNote
>     * The implicitly provided implementation returns a string which
>     * with the unqualified name of the record class and is
>     * followed by a list of components, in declaration order,
>     * enclosed in square brackets ({@code "[]"}).  Adjacent
>     * are separated by the characters {@code ", "} (comma and
>     * Each component is rendered as the name followed by an equals
>     * ({@code "="}) followed by a string representing the associated
>The language is intentionally vague about what is “a string
>the associated value”.  There are comments in the prototype that
>maybe adding quotes to some values (Strings).  So I left that open.
>— John

Thanks John.  This looks good to me.

More information about the amber-spec-experts mailing list