Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8251160: Fix "no comment" warnings in java.logging
Add missing documentation to the Serialized Form of Level and LogRecord.

Reviewed-by: lancea, mchung
  • Loading branch information
dfuch committed Aug 18, 2020
1 parent 354dcda commit 23edf8dbffb8ff3d499f87e468f03e89714ffd1c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
@@ -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,20 @@ public final int intValue() {
return value;
}

@Serial
private static final long serialVersionUID = -8176160795706313070L;

// Serialization magic to prevent "doppelgangers".
// This is a performance optimization.
/**
* Returns a {@code Level} instance with the same {@code name},
* {@code value}, and {@code resourceBundleName} as the deserialized
* object.
* @return a {@code Level} instance corresponding to the deserialized
* object.
*/
@Serial
private Object readResolve() {
// Serialization magic to prevent "doppelgangers".
// This is a performance optimization.
Optional<Level> level = KnownLevel.matches(this);
if (level.isPresent()) {
return level.get();
@@ -599,6 +599,10 @@ public void setThrown(Throwable thrown) {
* 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,14 @@ private void writeObject(ObjectOutputStream out) throws IOException {
* {@code threadID} which may be anything between {@code Integer.MIN_VALUE}
* and {Integer.MAX_VALUE}.
* </ul>
*
* 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)

0 comments on commit 23edf8d

Please sign in to comment.