RFR: 8254275: [valhalla/jep390] Revise "value-based class" & apply to wrappers [v5]
rriggs at openjdk.java.net
Mon Nov 23 19:44:10 UTC 2020
On Sat, 21 Nov 2020 00:31:36 GMT, Dan Smith <dlsmith at openjdk.org> wrote:
>> Polishing the specification of "value-based class" to align with requirements of inline classes, allow classes (like Integer) with deprecated constructors, and clarify expectations for clients.
>> Full docs build: http://cr.openjdk.java.net/~dlsmith/8254275/8254275-20201013/api/index.html
> Dan Smith has updated the pull request incrementally with one additional commit since the last revision:
> Review comments
src/java.base/share/classes/java/lang/doc-files/ValueBased.html line 40:
> 38: <li>the class declares only final instance fields (though these may contain references
> 39: to mutable objects);</li>
> 40: <li>the class declares implementations of <code>equals</code>,
Does saying the class "declares" the methods apply to Records and other classes that have provided or generated methods for equals, hashcode, and toString? Must the class explicitly declare the methods to meet the criteria?
Perhaps "the implementations of equals, hashCode, and tostring use only the instance's state...".
More information about the valhalla-dev