JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base
joe.darcy at oracle.com
Wed Aug 28 01:28:05 UTC 2019
Recent work for JDK-8202385: "Annotation to mark serial-related fields
and methods" added the java.io.Serial annotation type to the platform.
The intention of this new annotation type is to allow
serialization-related fields and methods to be marked as documentation
and to allow stricter compile-time checking, analogous to the checking
done for @Override. Implementing those stricter serialization-related
checks will be done under JDK-8202056.
Please review the application of java.io.Serial to types in the base
module other than security types:
JDK-8229997: Apply java.io.Serial annotations in java.base
(Security-related types in the base module are being handled under
As a reminder, the 5 serialization-related methods and 2 fields are:
* private void writeObject(java.io.ObjectOutputStream stream)
* private void readObject(java.io.ObjectInputStream stream) throws
* private void readObjectNoData() throws ObjectStreamException
* ANY-ACCESS-MODIFIER Object writeReplace() throws
* ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException
* private static final ObjectStreamField serialPersistentFields
* private static final long serialVersionUID
Due to the separate source code management policies for
java.util.concurrent, I did not include that package in this exercise.
Likewise, applying the annotation to some of the time-zone related files
caused build failures so I excluded those types as well.
More information about the core-libs-dev