RFR: 8355004: Apply java.io.Serial annotations in java.compiler
Sergey Bylokhov
serb at openjdk.org
Sat Apr 26 02:50:18 UTC 2025
Please review the application of `@Serial` annotation ([JDK-8202385](https://bugs.openjdk.org/browse/JDK-8202385)) to types in the compiler 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
Any feedback or suggestions are welcome!
-------------
Commit messages:
- use long literals
- Apply java.io.Serial annotations in java.compiler
Changes: https://git.openjdk.org/jdk/pull/24891/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24891&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8355004
Stats: 46 lines in 8 files changed: 29 ins; 4 del; 13 mod
Patch: https://git.openjdk.org/jdk/pull/24891.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24891/head:pull/24891
PR: https://git.openjdk.org/jdk/pull/24891
More information about the compiler-dev
mailing list