[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
>begins
> * with the unqualified name of the record class and is
>immediately
> * followed by a list of components, in declaration order,
> * enclosed in square brackets ({@code "[]"}). Adjacent
>components
> * are separated by the characters {@code ", "} (comma and
>space).
> * Each component is rendered as the name followed by an equals
>sign
> * ({@code "="}) followed by a string representing the associated
>value.
>
>The language is intentionally vague about what is “a string
>representing
>the associated value”. There are comments in the prototype that
>mention
>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