Integrated: 8359180: Apply java.io.Serial annotations in java.instrument
Sergey Bylokhov
serb at openjdk.org
Wed Jun 18 22:56:40 UTC 2025
On Tue, 10 Jun 2025 23:19:40 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> Please review the application of `@Serial` annotation ([JDK-8202385](https://bugs.openjdk.org/browse/JDK-8202385)) to types in the java.instrument module to enable stricter compile-time checking of serialization-related declarations. Just a few classes are covered.
>
> 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
>
>
> Example of a similar change in the [java.compiler](https://github.com/openjdk/jdk/pull/24891) module.
This pull request has now been integrated.
Changeset: 23e1e2ff
Author: Sergey Bylokhov <serb at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/23e1e2ff4a4a75ec268c7925fb98d6b96a01bbcf
Stats: 16 lines in 3 files changed: 12 ins; 1 del; 3 mod
8359180: Apply java.io.Serial annotations in java.instrument
Reviewed-by: phh, sspitsyn
-------------
PR: https://git.openjdk.org/jdk/pull/25738
More information about the serviceability-dev
mailing list