forbidding serialization methods as members of records
Chris Hegarty
chris.hegarty at oracle.com
Thu Oct 31 12:25:53 UTC 2019
> On 31 Oct 2019, at 12:21, Vicente Romero <vicente.romero at oracle.com> wrote:
>
> Hi,
>
> In the past we discussed about forbidding the declaration of some serialization related methods in records. In particular:
>
> writeObject(ObjectOutputStream)
> readObjectNoData()
> readObject(ObjectInputStream)
> 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,
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.
-Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20191031/c3485c96/attachment.html>
More information about the amber-spec-experts
mailing list