<AWT Dev> RFR: 8259439: Apply java.io.Serial annotations in java.datatransfer
Sergey Bylokhov
serb at openjdk.java.net
Fri Jan 8 06:57:05 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
@jddarcy please take a look, as far as I understand we do not create a CSR for such changes.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1996
More information about the awt-dev
mailing list