Updated Draft specs for JEP 359 (Records)

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Oct 31 17:14:56 UTC 2019

On 31/10/2019 16:11, Chris Hegarty wrote:
>> On 31 Oct 2019, at 15:29, Brian Goetz <brian.goetz at oracle.com> wrote:
>>> "It is a compile-time error for a record declaration to declare a record component with the name |clone|, |finalize|, |getClass|, |hashCode|, |notify|, |notifyAll|, |readObjectNoData|, |readResolve|, |serialPersistentFields|, |serialVersionUID|, |toString|, |wait|, or |writeReplace|."
>>> Chris says that the serialization spec ignores all the serialization-related methods if they appear inside a record; should we lift the restrictions?
>> But, I think we later decided we are not ignoring _all_ of the serialization-related methods — that a readResolve() method is OK.
> For records, the serialization runtime does consider the following:
>    1) writeReplace(), readResolve(), and
>    2) the serialVersionUID field
> The serialization runtime ignores the following:
>    a) writeObject, writeObjectNoData, readObject, and
>    b) serialPersistentFields, and
>    c) writeExternal and readExternal - for what they’re worth!

Ok, so, error on (1) and (2) and warnings in all the other cases?


> -Chris.

More information about the amber-spec-experts mailing list