<AWT Dev> Integrated: 8259439: Apply java.io.Serial annotations in java.datatransfer
Sergey Bylokhov
serb at openjdk.java.net
Mon Jan 11 23:17:57 UTC 2021
On Fri, 8 Jan 2021 04:51:50 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Please review the application of `@java.io.Serial` annotation (JDK-8202385) to types in the datatransfer module to enable stricter compile-time checking of serialization-related declarations.
>
> This annotation can be applied to these methods in the module:
> * private void writeObject(java.io.ObjectOutputStream stream) throws IOException
> * private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException
> * private void readObjectNoData() throws ObjectStreamException
> * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException
> * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException
> * private static final ObjectStreamField[] serialPersistentFields
> * private static final long serialVersionUID
>
> But only the `serialVersionUID` is updated since only this field is used in the datatransfer module.
>
> A similar fix was implemented for java.base module as well:
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-August/062046.html
This pull request has now been integrated.
Changeset: ff54b77b
Author: Sergey Bylokhov <serb at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/ff54b77b
Stats: 31 lines in 5 files changed: 19 ins; 0 del; 12 mod
8259439: Apply java.io.Serial annotations in java.datatransfer
Reviewed-by: aivanov, pbansal, trebari, darcy
-------------
PR: https://git.openjdk.java.net/jdk/pull/1996
More information about the awt-dev
mailing list