Updated specifications

Clement Cherlin ccherlin at gmail.com
Thu Jun 6 20:36:32 UTC 2024


Hi Gernot,

I believe that the contradiction is resolved if Record (which is abstract)
is also declared as a value class.

While the spec doesn't state explicitly that an identity class can extend
an abstract value class, I think that has to be the case if a Record can be
either value or identity, and also for the following binary compatibility
statement to be meaningful:

Modifying an abstract or final identity class to be a value class does not
> break compatibility with pre-existing binaries.


If an existing abstract identity class (such as Record) has identity
subclasses, and it does not break compatibility to modify Record to be a
value class, then those identity subclasses must continue to function with
an abstract value superclass.

I think it would be clearer if the spec were to explicitly state the
following:

* An identity class is permitted to extend an abstract value superclass.
* The abstract class java.lang.Record must be declared as a value class.

Cheers,
Clement

On Tue, Jun 4, 2024 at 1:58 AM Gernot Neppert <mcnepp02 at googlemail.com>
wrote:

>
>
> Hi Dan,
>
> these paragraphs seem contradictionary with regards to the allowed
> superclasses of value-classes:
>  8.1.1.5 forbids any identity-superclass other than Object, while 8.10
> states that the superclass of every (value-)record-class is (the
> identity-class) Record.
>
> To me, it looks as if 8.1.1.5 should mention Record as another possible
> implicit superclass.
>
> Regards, Gernot
>
>
>
>
> Am 03.06.2024 um 21:00 schrieb Dan Smith <daniel.smith at oracle.com>:
>
> I've posted updated specifications for JEP 401 here:
>
>
> https://cr.openjdk.org/~dlsmith/jep401/jep401-20240603/specs/value-objects-jls.html
>
> https://cr.openjdk.org/~dlsmith/jep401/jep401-20240603/specs/value-objects-jvms.html
>
> These are intended to address all the needs of JEP 401, and I don't expect
> many further revisions—but as always, happy to hear any feedback.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20240606/53357542/attachment-0001.htm>


More information about the valhalla-spec-observers mailing list