RFR: 8355004: Apply java.io.Serial annotations in java.compiler [v2]

Sergey Bylokhov serb at openjdk.org
Thu May 29 15:58:15 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!

Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'openjdk:master' into serial_compiler
 - use long literals
 - Apply java.io.Serial annotations in java.compiler

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24891/files
  - new: https://git.openjdk.org/jdk/pull/24891/files/af94d056..9dfe7802

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24891&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24891&range=00-01

  Stats: 200451 lines in 4118 files changed: 134696 ins; 45967 del; 19788 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