On Tue, 30 Jun 2026 07:54:54 GMT, Alan Bateman <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/Object.java line 40:
>>
>>> 38: * When preview features are enabled, subclasses of {@code
>>> java.lang.Object}
>>> 39: * are either {@linkplain Class#isValue value classes} or
>>> identity classes.
>>> 40: * A <em>value object</em> is an instance of a non-abstract
>>> value class. All
>>
>> Hello Alan, in several other places in the other JDK, we seem to refer to
>> such classes as concrete value class. Should we do the same here instead of
>> saying non-abstract value class?
>
> Defining a value object as an instance of non-abstract value classes works
> here, it's similar to the wording in the changes for the JLS.
I would prefer to phrase it like "the class of a value object is a value
class", more in line with code like `o.getClass().isValue()`.
However, Valhalla models "identity" as the extra thing, so I guess it is better
to go like "An identity object is an object whose class is an identity class or
an array type. All other objects are value objects."
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2588#discussion_r3498620278