--- old/src/java.logging/share/classes/java/util/logging/Level.java 2020-08-13 11:48:45.000000000 +0100 +++ new/src/java.logging/share/classes/java/util/logging/Level.java 2020-08-13 11:48:45.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package java.util.logging; +import java.io.Serial; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; @@ -432,11 +433,25 @@ return value; } + @Serial private static final long serialVersionUID = -8176160795706313070L; - // Serialization magic to prevent "doppelgangers". - // This is a performance optimization. + /** + * This method prevents creating two different instances of + * {@code Level} with the same characteristics. + * If a matching level is found in the local system that corresponds + * to the deserialized object, the deserialized object is replaced + * by the existing instance. Otherwise, a new instance of {@code Level} + * is created and substituted to the deserialized object. + * The returned {@code Level} instance will have the same {@code name}, + * {@code value}, and {@code resourceBundleName} as the deserialized + * object, but no further guarantee is made. + * @return A {@code Level} instance with equivalent characteristics. + */ + @Serial private Object readResolve() { + // Serialization magic to prevent "doppelgangers". + // This is a performance optimization. Optional level = KnownLevel.matches(this); if (level.isPresent()) { return level.get(); --- old/src/java.logging/share/classes/java/util/logging/LogRecord.java 2020-08-13 11:48:46.000000000 +0100 +++ new/src/java.logging/share/classes/java/util/logging/LogRecord.java 2020-08-13 11:48:46.000000000 +0100 @@ -599,6 +599,10 @@ * by String values for each parameter. If a parameter is null, then * a null String is written. Otherwise the output of Object.toString() * is written. + * + * @param out the {@code ObjectOutputStream} to write to + * + * @throws IOException if I/O errors occur */ @Serial private void writeObject(ObjectOutputStream out) throws IOException { @@ -647,6 +651,13 @@ * {@code threadID} which may be anything between {@code Integer.MIN_VALUE} * and {Integer.MAX_VALUE}. * + * See {@code writeObject} for a description of the serial form. + * + * @param in the {@code ObjectInputStream} to read from + * + * @throws ClassNotFoundException if the class of a serialized object + * could not be found. + * @throws IOException if an I/O error occurs. */ @Serial private void readObject(ObjectInputStream in)