Updated Draft specs for JEP 359 (Records)

Chris Hegarty chris.hegarty at oracle.com
Thu Oct 31 14:51:11 UTC 2019



> On 31 Oct 2019, at 14:42, Srikanth <srikanth.adayapalam at oracle.com> wrote:
> 
> On 31/10/19 7:59 PM, Maurizio Cimadamore wrote:
>> Related to the earlier discussion on forbidden record members - how is this section still relevant?
>> 
>> "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?
> 
> When I was going through the spec draft, I rationalized this to myself by saying the synthesized accessor methods would very likely clash with jlO methods. Isn't that the case ??

Exactly. This is orthogonal to the issue of javac prohibiting the declaration of serialization-related methods ( which I think we’re converging on removing, and replacing with, possibly, a warning ).

-Chris.


More information about the amber-dev mailing list