RFR: 8254275: Development to revise "value-based class" & apply to wrappers [v3]

Dan Smith dlsmith at openjdk.java.net
Fri Oct 16 22:08:23 UTC 2020


On Fri, 16 Oct 2020 20:54:19 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Dan Smith has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Addressing review comments in ValueBased.html
>
> src/java.base/share/classes/java/lang/doc-files/ValueBased.html line 55:
> 
>> 53:         instances are equal according to <code>equals()</code>, they may also be
>> 54:         equal according to <code>==</code>;</li>
>> 55:     <li>are final;</li>
> 
> It might be useful to be able to mark an abstract class as @ValueBased to document that it is part of an intended
> ValueBased class hierarchy. Perhaps add "or be abstract".

The way this has been handled until now is to say "all implementing classes should be value-based" in the abstract
class's (or factory method's) javadoc. In terms of prose, that seems to get the job done, without needing to complicate
the definition of *value-based class*.

For the annotation, yes the intent is that it will be applied both to value-based classes and to abstract
classes/interfaces that require all implementing classes to be value-based.

-------------

PR: https://git.openjdk.java.net/valhalla/pull/222



More information about the valhalla-dev mailing list