<AWT Dev> RFR: 8259439: Apply java.io.Serial annotations in java.datatransfer

Alexey Ivanov aivanov at openjdk.java.net
Fri Jan 8 22:54:54 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

Marked as reviewed by aivanov (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/1996


More information about the awt-dev mailing list