8251203: Fix "no comment" warnings in java.base/java.lang and java/io

Reviewed-by: dfuchs, lancea, mchung, naoto
This commit is contained in:
Roger Riggs 2020-08-25 10:20:14 -04:00
parent 5585e6f63a
commit afce1f4ebd
19 changed files with 177 additions and 28 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -2231,6 +2231,9 @@ public class File
* in case the path is reconstituted on a different host type. * in case the path is reconstituted on a different host type.
* *
* @serialData Default fields followed by separator character. * @serialData Default fields followed by separator character.
*
* @param s the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private synchronized void writeObject(java.io.ObjectOutputStream s) private synchronized void writeObject(java.io.ObjectOutputStream s)
@ -2245,6 +2248,10 @@ public class File
* The original separator character is read. If it is different * The original separator character is read. If it is different
* than the separator character on this system, then the old separator * than the separator character on this system, then the old separator
* is replaced by the local separator. * is replaced by the local separator.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private synchronized void readObject(java.io.ObjectInputStream s) private synchronized void readObject(java.io.ObjectInputStream s)

View file

@ -1247,9 +1247,12 @@ final class FilePermissionCollection extends PermissionCollection
/** /**
* @serialData "permissions" field (a Vector containing the FilePermissions). * @serialData "permissions" field (a Vector containing the FilePermissions).
*/ */
/* /**
* Writes the contents of the perms field out as a Vector for * Writes the contents of the perms field out as a Vector for
* serialization compatibility with earlier releases. * serialization compatibility with earlier releases.
*
* @param out the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException { private void writeObject(ObjectOutputStream out) throws IOException {
@ -1263,8 +1266,12 @@ final class FilePermissionCollection extends PermissionCollection
out.writeFields(); out.writeFields();
} }
/* /**
* Reads in a Vector of FilePermissions and saves them in the perms field. * Reads in a Vector of FilePermissions and saves them in the perms field.
*
* @param in the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(ObjectInputStream in) private void readObject(ObjectInputStream in)

View file

@ -93,6 +93,9 @@ public class ObjectStreamClass implements Serializable {
@java.io.Serial @java.io.Serial
private static final long serialVersionUID = -6120832682080437368L; private static final long serialVersionUID = -6120832682080437368L;
/**
* {@code ObjectStreamClass} has no fields for default serialization.
*/
@java.io.Serial @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = private static final ObjectStreamField[] serialPersistentFields =
NO_FIELDS; NO_FIELDS;
@ -2538,7 +2541,9 @@ public class ObjectStreamClass implements Serializable {
} }
} }
// a LRA cache of record deserialization constructors /**
* A LRA cache of record deserialization constructors.
*/
@SuppressWarnings("serial") @SuppressWarnings("serial")
private static final class DeserializationConstructorsCache private static final class DeserializationConstructorsCache
extends ConcurrentHashMap<DeserializationConstructorsCache.Key, MethodHandle> { extends ConcurrentHashMap<DeserializationConstructorsCache.Key, MethodHandle> {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,6 +76,9 @@ public class UncheckedIOException extends RuntimeException {
/** /**
* Called to read the object from a stream. * Called to read the object from a stream.
* *
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
* @throws InvalidObjectException * @throws InvalidObjectException
* if the object is invalid or has a cause that is not * if the object is invalid or has a cause that is not
* an {@code IOException} * an {@code IOException}

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -585,7 +585,12 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
return this; return this;
} }
// Documentation in subclasses because of synchro difference /**
* Appends the specified {@code StringBuffer} to this sequence.
*
* @param sb the {@code StringBuffer} to append.
* @return a reference to this object.
*/
public AbstractStringBuilder append(StringBuffer sb) { public AbstractStringBuilder append(StringBuffer sb) {
return this.append((AbstractStringBuilder)sb); return this.append((AbstractStringBuilder)sb);
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -110,14 +110,14 @@ public class ClassNotFoundException extends ReflectiveOperationException {
/** /**
* Serializable fields for ClassNotFoundException. * Serializable fields for ClassNotFoundException.
* *
* @serialField ex Throwable * @serialField ex Throwable the {@code Throwable}
*/ */
@java.io.Serial @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = { private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("ex", Throwable.class) new ObjectStreamField("ex", Throwable.class)
}; };
/* /**
* Reconstitutes the ClassNotFoundException instance from a stream * Reconstitutes the ClassNotFoundException instance from a stream
* and initialize the cause properly when deserializing from an older * and initialize the cause properly when deserializing from an older
* version. * version.
@ -125,6 +125,10 @@ public class ClassNotFoundException extends ReflectiveOperationException {
* The getException and getCause method returns the private "ex" field * The getException and getCause method returns the private "ex" field
* in the older implementation and ClassNotFoundException::cause * in the older implementation and ClassNotFoundException::cause
* was set to null. * was set to null.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
@ -135,9 +139,12 @@ public class ClassNotFoundException extends ReflectiveOperationException {
} }
} }
/* /**
* To maintain compatibility with older implementation, write a serial * To maintain compatibility with older implementation, write a serial
* "ex" field with the cause as the value. * "ex" field with the cause as the value.
*
* @param out the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException { private void writeObject(ObjectOutputStream out) throws IOException {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -108,14 +108,14 @@ public class ExceptionInInitializerError extends LinkageError {
/** /**
* Serializable fields for ExceptionInInitializerError. * Serializable fields for ExceptionInInitializerError.
* *
* @serialField exception Throwable * @serialField exception Throwable the exception
*/ */
@java.io.Serial @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = { private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("exception", Throwable.class) new ObjectStreamField("exception", Throwable.class)
}; };
/* /**
* Reconstitutes the ExceptionInInitializerError instance from a stream * Reconstitutes the ExceptionInInitializerError instance from a stream
* and initialize the cause properly when deserializing from an older * and initialize the cause properly when deserializing from an older
* version. * version.
@ -123,6 +123,10 @@ public class ExceptionInInitializerError extends LinkageError {
* The getException and getCause method returns the private "exception" * The getException and getCause method returns the private "exception"
* field in the older implementation and ExceptionInInitializerError::cause * field in the older implementation and ExceptionInInitializerError::cause
* was set to null. * was set to null.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
@ -133,9 +137,12 @@ public class ExceptionInInitializerError extends LinkageError {
} }
} }
/* /**
* To maintain compatibility with older implementation, write a serial * To maintain compatibility with older implementation, write a serial
* "exception" field with the cause as the value. * "exception" field with the cause as the value.
*
* @param out the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException { private void writeObject(ObjectOutputStream out) throws IOException {

View file

@ -60,13 +60,37 @@ public final class StackTraceElement implements java.io.Serializable {
private transient Class<?> declaringClassObject; private transient Class<?> declaringClassObject;
// Normally initialized by VM // Normally initialized by VM
/**
* The name of the class loader.
*/
private String classLoaderName; private String classLoaderName;
/**
* The module name.
*/
private String moduleName; private String moduleName;
/**
* The module version.
*/
private String moduleVersion; private String moduleVersion;
/**
* The declaring class.
*/
private String declaringClass; private String declaringClass;
/**
* The method name.
*/
private String methodName; private String methodName;
/**
* The source file name.
*/
private String fileName; private String fileName;
/**
* The source line number.
*/
private int lineNumber; private int lineNumber;
/**
* Control to show full or partial module, package, and class names.
*/
private byte format = 0; // Default to show all private byte format = 0; // Default to show all
/** /**

View file

@ -1236,6 +1236,10 @@ public final class String
*/ */
public static final Comparator<String> CASE_INSENSITIVE_ORDER public static final Comparator<String> CASE_INSENSITIVE_ORDER
= new CaseInsensitiveComparator(); = new CaseInsensitiveComparator();
/**
* CaseInsensitiveComparator for Strings.
*/
private static class CaseInsensitiveComparator private static class CaseInsensitiveComparator
implements Comparator<String>, java.io.Serializable { implements Comparator<String>, java.io.Serializable {
// use serialVersionUID from JDK 1.2.2 for interoperability // use serialVersionUID from JDK 1.2.2 for interoperability

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
package java.lang; package java.lang;
import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
@ -733,8 +734,11 @@ import jdk.internal.HotSpotIntrinsicCandidate;
}; };
/** /**
* readObject is called to restore the state of the StringBuffer from * The {@code writeObject} method is called to write the state of the {@code StringBuffer} to
* a stream. * a stream.
*
* @param s the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private synchronized void writeObject(java.io.ObjectOutputStream s) private synchronized void writeObject(java.io.ObjectOutputStream s)
@ -753,8 +757,12 @@ import jdk.internal.HotSpotIntrinsicCandidate;
} }
/** /**
* readObject is called to restore the state of the StringBuffer from * The {@code readObject} method is called to restore the state of the {@code StringBuffer} from
* a stream. * a stream.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(java.io.ObjectInputStream s) private void readObject(java.io.ObjectInputStream s)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,8 @@ package java.lang;
import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.HotSpotIntrinsicCandidate;
import java.io.IOException;
/** /**
* A mutable sequence of characters. This class provides an API compatible * A mutable sequence of characters. This class provides an API compatible
* with {@code StringBuffer}, but with no guarantee of synchronization. * with {@code StringBuffer}, but with no guarantee of synchronization.
@ -458,6 +460,9 @@ public final class StringBuilder
* {@code char} array may be greater than the number of * {@code char} array may be greater than the number of
* characters currently stored in the string builder, in which * characters currently stored in the string builder, in which
* case extra characters are ignored. * case extra characters are ignored.
*
* @param s the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private void writeObject(java.io.ObjectOutputStream s) private void writeObject(java.io.ObjectOutputStream s)
@ -476,10 +481,14 @@ public final class StringBuilder
/** /**
* readObject is called to restore the state of the StringBuffer from * readObject is called to restore the state of the StringBuffer from
* a stream. * a stream.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(java.io.ObjectInputStream s) private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
s.defaultReadObject(); s.defaultReadObject();
count = s.readInt(); count = s.readInt();
char[] val = (char[]) s.readObject(); char[] val = (char[]) s.readObject();

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -902,6 +902,10 @@ public class Throwable implements Serializable {
* Note that there are no constraints on the value the {@code * Note that there are no constraints on the value the {@code
* cause} field can hold; both {@code null} and {@code this} are * cause} field can hold; both {@code null} and {@code this} are
* valid values for the field. * valid values for the field.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(ObjectInputStream s) private void readObject(ObjectInputStream s)
@ -991,6 +995,9 @@ public class Throwable implements Serializable {
* A {@code null} stack trace field is represented in the serial * A {@code null} stack trace field is represented in the serial
* form as a one-element array whose element is equal to {@code * form as a one-element array whose element is equal to {@code
* new StackTraceElement("", "", null, Integer.MIN_VALUE)}. * new StackTraceElement("", "", null, Integer.MIN_VALUE)}.
*
* @param s the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private synchronized void writeObject(ObjectOutputStream s) private synchronized void writeObject(ObjectOutputStream s)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,6 +47,9 @@ public class TypeNotPresentException extends RuntimeException {
@java.io.Serial @java.io.Serial
private static final long serialVersionUID = -5101214195716534496L; private static final long serialVersionUID = -5101214195716534496L;
/**
* The type name.
*/
private String typeName; private String typeName;
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,13 @@ public class IncompleteAnnotationException extends RuntimeException {
@java.io.Serial @java.io.Serial
private static final long serialVersionUID = 8445097402741811912L; private static final long serialVersionUID = 8445097402741811912L;
/**
* The annotation type.
*/
private Class<? extends Annotation> annotationType; private Class<? extends Annotation> annotationType;
/**
* The element name.
*/
private String elementName; private String elementName;
/** /**

View file

@ -937,6 +937,9 @@ class InvokerBytecodeGenerator {
} }
} }
/**
* The BytecodeGenerationException.
*/
@SuppressWarnings("serial") @SuppressWarnings("serial")
static final class BytecodeGenerationException extends RuntimeException { static final class BytecodeGenerationException extends RuntimeException {
BytecodeGenerationException(Exception cause) { BytecodeGenerationException(Exception cause) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -67,15 +67,45 @@ import java.util.Objects;
public final class SerializedLambda implements Serializable { public final class SerializedLambda implements Serializable {
@java.io.Serial @java.io.Serial
private static final long serialVersionUID = 8025925345765570181L; private static final long serialVersionUID = 8025925345765570181L;
/**
* The capturing class.
*/
private final Class<?> capturingClass; private final Class<?> capturingClass;
/**
* The functional interface class.
*/
private final String functionalInterfaceClass; private final String functionalInterfaceClass;
/**
* The functional interface method name.
*/
private final String functionalInterfaceMethodName; private final String functionalInterfaceMethodName;
/**
* The functional interface method signature.
*/
private final String functionalInterfaceMethodSignature; private final String functionalInterfaceMethodSignature;
/**
* The implementation class.
*/
private final String implClass; private final String implClass;
/**
* The implementation method name.
*/
private final String implMethodName; private final String implMethodName;
/**
* The implementation method signature.
*/
private final String implMethodSignature; private final String implMethodSignature;
/**
* The implementation method kind.
*/
private final int implMethodKind; private final int implMethodKind;
/**
* The instantiated method type.
*/
private final String instantiatedMethodType; private final String instantiatedMethodType;
/**
* The captured arguments.
*/
@SuppressWarnings("serial") // Not statically typed as Serializable @SuppressWarnings("serial") // Not statically typed as Serializable
private final Object[] capturedArgs; private final Object[] capturedArgs;
@ -227,6 +257,11 @@ public final class SerializedLambda implements Serializable {
return capturedArgs[i]; return capturedArgs[i];
} }
/**
* Resolve a {@code SerializedLambda} to an object.
* @return a SerializedLambda
* @throws ObjectStreamException if the object is not valid
*/
@java.io.Serial @java.io.Serial
private Object readResolve() throws ObjectStreamException { private Object readResolve() throws ObjectStreamException {
try { try {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -107,17 +107,21 @@ public class UndeclaredThrowableException extends RuntimeException {
/** /**
* Serializable fields for UndeclaredThrowableException. * Serializable fields for UndeclaredThrowableException.
* *
* @serialField undeclaredThrowable Throwable * @serialField undeclaredThrowable Throwable the undeclared exception
*/ */
@java.io.Serial @java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = { private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("undeclaredThrowable", Throwable.class) new ObjectStreamField("undeclaredThrowable", Throwable.class)
}; };
/* /**
* Reconstitutes the UndeclaredThrowableException instance from a stream * Reconstitutes the UndeclaredThrowableException instance from a stream
* and initialize the cause properly when deserializing from an older * and initialize the cause properly when deserializing from an older
* version. * version.
*
* @param s the {@code ObjectInputStream} from which data is read
* @throws IOException if an I/O error occurs
* @throws ClassNotFoundException if a serialized class cannot be loaded
*/ */
@java.io.Serial @java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
@ -128,9 +132,12 @@ public class UndeclaredThrowableException extends RuntimeException {
} }
} }
/* /**
* To maintain compatibility with older implementation, write a serial * To maintain compatibility with older implementation, write a serial
* "ex" field with the cause as the value. * "ex" field with the cause as the value.
*
* @param out the {@code ObjectOutputStream} to which data is written
* @throws IOException if an I/O error occurs
*/ */
@java.io.Serial @java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException { private void writeObject(ObjectOutputStream out) throws IOException {

View file

@ -354,6 +354,7 @@ public final class ValueRange implements Serializable {
* Check that the values are valid. * Check that the values are valid.
* *
* @param s the stream to read * @param s the stream to read
* @throws IOException if an I/O error occurs
* @throws InvalidObjectException if * @throws InvalidObjectException if
* the smallest minimum is greater than the smallest maximum, * the smallest minimum is greater than the smallest maximum,
* or the smallest maximum is greater than the largest maximum * or the smallest maximum is greater than the largest maximum

View file

@ -359,6 +359,7 @@ public final class WeekFields implements Serializable {
* Check that the values are valid. * Check that the values are valid.
* *
* @param s the stream to read * @param s the stream to read
* @throws IOException if an I/O error occurs
* @throws InvalidObjectException if the serialized object has an invalid * @throws InvalidObjectException if the serialized object has an invalid
* value for firstDayOfWeek or minimalDays. * value for firstDayOfWeek or minimalDays.
* @throws ClassNotFoundException if a class cannot be resolved * @throws ClassNotFoundException if a class cannot be resolved