On 31/10/2019 16:11, Chris Hegarty wrote:
On 31 Oct 2019, at 15:29, Brian Goetz <brian.go...@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.
FTR
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?
Maurizio
-Chris.