On Thu, 16 Jul 2026 14:20:51 GMT, Viktor Klang <[email protected]> wrote:

>> `ValueBased` talks about constructor avoidance but does not specify the 
>> reason. It's better to include the reason because it's not straightforward 
>> from the fact that there's no binary incompatibility.
>> 
>> Also `InvalidClassException` benefits from descriptions about 
>> strictly-initialized fields.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/java.base/share/classes/java/lang/doc-files/ValueBased.html line 58:
> 
>> 56:         equal according to {@code ==};</li>
>> 57:     <li>the class is final, and extends either {@code Object} or a 
>> hierarchy of
>> 58:         abstract classes.</li>
> 
> I was under the impression that supertypes of value calsses must be either 
> abstract value classes or java.lang.Object?

Yes. But notice a "value-based" class can exist when preview features are 
disabled, in which case, all the superclasses of the VBC can only be abstract 
without being value (a preview-only concept)

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2631#discussion_r3596278330

Reply via email to