RFR: 8361533: Apply java.io.Serial annotations in java.logging

Alan Bateman alanb at openjdk.org
Tue Jul 15 06:30:43 UTC 2025


On Wed, 9 Jul 2025 02:58:28 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Please review the application of the `@Serial` annotation ([JDK-8202385](https://bugs.openjdk.org/browse/JDK-8202385)) to types in the java.logging module to enable stricter compile-time checking of serialization-related declarations. Only one class remains to be covered; all other relevant fields and methods are already annotated with `@Serial`.
> 
> 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 is okay but just to point out that the SecurityManager feature is disabled completely since JDK 24 and LoggingPermission is deprecated for removal. So unlikely that new code will make use of this.

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

PR Comment: https://git.openjdk.org/jdk/pull/26208#issuecomment-3072179227


More information about the core-libs-dev mailing list