On Thu, 16 Jul 2026 14:23:51 GMT, Chen Liang <[email protected]> wrote:
>> 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)
This list starts with the statement:
The compiler and runtime enforce the value based properties below if it is
declared
as {@code value class} and preview features are enabled.
A value-based class has the following properties:
So I think we can presume that the list is "under the circumstance of preview
being enabled". In which case we should be able to say "abstract value class"?
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2631#discussion_r3596301433