<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Chris Hegarty" <chris.hegarty@oracle.com><br><b>À: </b>"Vicente Romero" <vicente.romero@oracle.com><br><b>Cc: </b>"amber-spec-experts" <amber-spec-experts@openjdk.java.net><br><b>Envoyé: </b>Jeudi 31 Octobre 2019 13:25:53<br><b>Objet: </b>Re: forbidding serialization methods as members of records<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br class=""><div><br class=""><blockquote class=""><div class="">On 31 Oct 2019, at 12:21, Vicente Romero <<a href="mailto:vicente.romero@oracle.com" class="" target="_blank">vicente.romero@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<div class="">
Hi,<br class="">
<br class="">
In the past we discussed about forbidding the declaration of some
serialization related methods in records. In particular:<br class="">
<font class="" size="+1"><br class=""><span class="c-message__body" dir="auto"><pre class="c-mrkdwn__pre">writeObject(ObjectOutputStream)
readObjectNoData()
readObject(ObjectInputStream)</pre></span></font>I wonder if we still want to enforce that
restriction, meaning that it should be reflected in the spec, or if
it is not necessary anymore,<br class=""></div></div></blockquote><br class=""></div><div>Where we ended up with Serializable Records, is that the runtime is specified to ignore these methods if they appear in a serializable record ( there are tests that assert this ). The javac restriction is no longer strictly necessary, but of course catches effectively-useless declarations early, and without resorting checkers, inspection, etc.</div></blockquote><div><br></div><div>It is necessary from a user point of view to have a javac error, having something that silently fails is the worst in term of user experience.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div>-Chris.</div></blockquote><div><br></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>