Updated Draft specs for JEP 359 (Records)

Chris Hegarty chris.hegarty at oracle.com
Thu Oct 31 16:11:53 UTC 2019

> 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!


More information about the amber-spec-experts mailing list