8229997: Apply java.io.Serial annotations in java.base

Reviewed-by: alanb, rriggs
This commit is contained in:
Joe Darcy 2019-08-29 16:31:34 -07:00
parent 6d064a747e
commit 9d764ee48e
315 changed files with 880 additions and 254 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, 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
@ -716,6 +716,7 @@ class Attribute implements Comparable<Attribute> {
public static
class FormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -2542243830788066513L;
private int ctype;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2019, 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
@ -605,6 +605,7 @@ class ClassReader {
}
static class ClassFormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -3564121733989501833L;
public ClassFormatException(String message) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2019, 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
@ -679,6 +679,7 @@ class Instruction {
}
}
static class FormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 3175572275651367015L;
FormatException(String message) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -33,6 +33,7 @@ package java.io;
public class CharConversionException
extends java.io.IOException
{
@java.io.Serial
private static final long serialVersionUID = -8680016352018427031L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -40,6 +40,7 @@ package java.io;
*/
public
class EOFException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 6433858223774886977L;
/**

View file

@ -2217,6 +2217,7 @@ public class File
*
* @serialData Default fields followed by separator character.
*/
@java.io.Serial
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws IOException
{
@ -2230,6 +2231,7 @@ public class File
* than the separator character on this system, then the old separator
* is replaced by the local separator.
*/
@java.io.Serial
private synchronized void readObject(java.io.ObjectInputStream s)
throws IOException, ClassNotFoundException
{
@ -2251,6 +2253,7 @@ public class File
= UNSAFE.objectFieldOffset(File.class, "prefixLength");
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = 301077366599181567L;
// -- Integration with java.nio.file --

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -41,6 +41,7 @@ package java.io;
*/
public class FileNotFoundException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -897856973823710492L;
/**

View file

@ -195,6 +195,7 @@ public final class FilePermission extends Permission implements Serializable {
// return sb.toString();
// }
@java.io.Serial
private static final long serialVersionUID = 7930732926638008763L;
/**
@ -1040,6 +1041,7 @@ public final class FilePermission extends Permission implements Serializable {
* to a stream. The actions are serialized, and the superclass
* takes care of the name.
*/
@java.io.Serial
private void writeObject(ObjectOutputStream s)
throws IOException
{
@ -1054,6 +1056,7 @@ public final class FilePermission extends Permission implements Serializable {
* readObject is called to restore the state of the FilePermission from
* a stream.
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
@ -1210,6 +1213,7 @@ final class FilePermissionCollection extends PermissionCollection
return perms.elements();
}
@java.io.Serial
private static final long serialVersionUID = 2202956749081564585L;
// Need to maintain serialization interoperability with earlier releases,
@ -1220,6 +1224,7 @@ final class FilePermissionCollection extends PermissionCollection
* @serialField permissions java.util.Vector
* A list of FilePermission objects.
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("permissions", Vector.class),
};
@ -1231,6 +1236,7 @@ final class FilePermissionCollection extends PermissionCollection
* Writes the contents of the perms field out as a Vector for
* serialization compatibility with earlier releases.
*/
@java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException {
// Don't call out.defaultWriteObject()
@ -1245,6 +1251,7 @@ final class FilePermissionCollection extends PermissionCollection
/*
* Reads in a Vector of FilePermissions and saves them in the perms field.
*/
@java.io.Serial
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2019, 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
@ -46,5 +46,6 @@ public class IOError extends Error {
super(cause);
}
@java.io.Serial
private static final long serialVersionUID = 67100927991680413L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -37,6 +37,7 @@ package java.io;
*/
public
class IOException extends Exception {
@java.io.Serial
static final long serialVersionUID = 7818375828146090155L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -41,6 +41,7 @@ package java.io;
*/
public
class InterruptedIOException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 4020568460727500567L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -40,6 +40,7 @@ package java.io;
*/
public class InvalidClassException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = -4333316296251054416L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -37,6 +37,7 @@ package java.io;
*/
public class InvalidObjectException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = 3233174318281839583L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -33,6 +33,7 @@ package java.io;
*/
public class NotActiveException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = -3893467273049808895L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -35,6 +35,7 @@ package java.io;
*/
public class NotSerializableException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = 2906642554793891381L;
/**

View file

@ -84,7 +84,9 @@ public class ObjectStreamClass implements Serializable {
public static final ObjectStreamField[] NO_FIELDS =
new ObjectStreamField[0];
@java.io.Serial
private static final long serialVersionUID = -6120832682080437368L;
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields =
NO_FIELDS;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -33,6 +33,7 @@ package java.io;
*/
public abstract class ObjectStreamException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 7260898174833392607L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -47,6 +47,7 @@ package java.io;
*/
public class OptionalDataException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = -8011121865681257820L;
/*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, 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
@ -101,6 +101,7 @@ import java.util.StringTokenizer;
public final class SerializablePermission extends BasicPermission {
@java.io.Serial
private static final long serialVersionUID = 8537212141160296410L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -34,6 +34,7 @@ package java.io;
*/
public class StreamCorruptedException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = 8983558202217591746L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -34,6 +34,7 @@ package java.io;
* @since 1.1
*/
public class SyncFailedException extends IOException {
@java.io.Serial
private static final long serialVersionUID = -2353342684412443330L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -44,6 +44,7 @@ package java.io;
*/
public
class UTFDataFormatException extends IOException {
@java.io.Serial
private static final long serialVersionUID = 420743449228280612L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, 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
@ -32,6 +32,7 @@ import java.util.Objects;
* @since 1.8
*/
public class UncheckedIOException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -8134305061645241065L;
/**
@ -79,6 +80,7 @@ public class UncheckedIOException extends RuntimeException {
* if the object is invalid or has a cause that is not
* an {@code IOException}
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -33,6 +33,7 @@ package java.io;
public class UnsupportedEncodingException
extends IOException
{
@java.io.Serial
private static final long serialVersionUID = -4274276298326136670L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -44,6 +44,7 @@ package java.io;
* @since 1.1
*/
public class WriteAbortedException extends ObjectStreamException {
@java.io.Serial
private static final long serialVersionUID = -3326426625597282442L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -37,6 +37,7 @@ package java.lang;
*/
public
class AbstractMethodError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -1654391082989018462L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -39,6 +39,7 @@ package java.lang;
* @since 1.0
*/
public class ArithmeticException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 2256477558314496007L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -32,6 +32,7 @@ package java.lang;
* @since 1.0
*/
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
@java.io.Serial
private static final long serialVersionUID = -5116101128118950844L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -39,6 +39,7 @@ package java.lang;
*/
public
class ArrayStoreException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -4522193890499838241L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, 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
@ -41,6 +41,7 @@ package java.lang;
* @since 1.4
*/
public class AssertionError extends Error {
@java.io.Serial
private static final long serialVersionUID = -5013299493970297370L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -73,6 +73,7 @@ public final class Boolean implements java.io.Serializable,
private final boolean value;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -3665804199014368530L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2019, 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
@ -40,6 +40,7 @@ package java.lang;
* @since 1.7
*/
public class BootstrapMethodError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 292L;
/**

View file

@ -561,5 +561,6 @@ public final class Byte extends Number implements Comparable<Byte> {
public static final int BYTES = SIZE / Byte.SIZE;
/** use serialVersionUID from JDK 1.1. for interoperability */
@java.io.Serial
private static final long serialVersionUID = -7183698231559129828L;
}

View file

@ -8293,6 +8293,7 @@ class Character implements java.io.Serializable, Comparable<Character> {
private final char value;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = 3786198910865385080L;
/**

View file

@ -3421,6 +3421,7 @@ public final class Class<T> implements java.io.Serializable,
}
/** use serialVersionUID from JDK 1.1 for interoperability */
@java.io.Serial
private static final long serialVersionUID = 3206093459760846163L;
@ -3440,6 +3441,7 @@ public final class Class<T> implements java.io.Serializable,
*
* @see java.io.ObjectStreamClass
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields =
new ObjectStreamField[0];

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -39,6 +39,7 @@ package java.lang;
*/
public
class ClassCastException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -9223365651070458532L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
* @since 1.0
*/
public class ClassCircularityError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 1054362542914539689L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
*/
public
class ClassFormatError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -8420114879011949195L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -59,6 +59,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
/**
* use serialVersionUID from JDK 1.1.X for interoperability
*/
@java.io.Serial
private static final long serialVersionUID = 9176873029745254542L;
/**
@ -111,6 +112,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
*
* @serialField ex Throwable
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("ex", Throwable.class)
};
@ -124,6 +126,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
* in the older implementation and ClassNotFoundException::cause
* was set to null.
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();
Throwable exception = (Throwable) fields.get("ex", null);
@ -136,6 +139,7 @@ public class ClassNotFoundException extends ReflectiveOperationException {
* To maintain compatibility with older implementation, write a serial
* "ex" field with the cause as the value.
*/
@java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException {
ObjectOutputStream.PutField fields = out.putFields();
fields.put("ex", super.getCause());

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -43,6 +43,7 @@ package java.lang;
public
class CloneNotSupportedException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 5195511250079656443L;
/**

View file

@ -1102,5 +1102,6 @@ public final class Double extends Number
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -9172774392245257468L;
}

View file

@ -275,11 +275,13 @@ public abstract class Enum<E extends Enum<E>>
/**
* prevent default deserialization
*/
@java.io.Serial
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
throw new InvalidObjectException("can't deserialize enum");
}
@java.io.Serial
private void readObjectNoData() throws ObjectStreamException {
throw new InvalidObjectException("can't deserialize enum");
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, 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
@ -38,6 +38,7 @@ package java.lang;
*/
@SuppressWarnings("rawtypes") /* rawtypes are part of the public api */
public class EnumConstantNotPresentException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -6046998521960521108L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -47,6 +47,7 @@ package java.lang;
* @since 1.0
*/
public class Error extends Throwable {
@java.io.Serial
static final long serialVersionUID = 4980196508277280342L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -43,6 +43,7 @@ package java.lang;
* @since 1.0
*/
public class Exception extends Throwable {
@java.io.Serial
static final long serialVersionUID = -3387516993124229948L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -50,6 +50,7 @@ public class ExceptionInInitializerError extends LinkageError {
/**
* Use serialVersionUID from JDK 1.1.X for interoperability
*/
@java.io.Serial
private static final long serialVersionUID = 1521711792217232256L;
/**
@ -109,6 +110,7 @@ public class ExceptionInInitializerError extends LinkageError {
*
* @serialField exception Throwable
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("exception", Throwable.class)
};
@ -122,6 +124,7 @@ public class ExceptionInInitializerError extends LinkageError {
* field in the older implementation and ExceptionInInitializerError::cause
* was set to null.
*/
@java.io.Serial
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();
Throwable exception = (Throwable) fields.get("exception", null);
@ -134,6 +137,7 @@ public class ExceptionInInitializerError extends LinkageError {
* To maintain compatibility with older implementation, write a serial
* "exception" field with the cause as the value.
*/
@java.io.Serial
private void writeObject(ObjectOutputStream out) throws IOException {
ObjectOutputStream.PutField fields = out.putFields();
fields.put("exception", super.getCause());

View file

@ -1014,5 +1014,6 @@ public final class Float extends Number
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -2671257302660747028L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -37,6 +37,7 @@ package java.lang;
* @since 1.0
*/
public class IllegalAccessError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -8988904074992417891L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -90,5 +90,6 @@ class IllegalArgumentException extends RuntimeException {
super(cause);
}
@java.io.Serial
private static final long serialVersionUID = -5365630128856068164L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -72,5 +72,6 @@ public class IllegalCallerException extends RuntimeException {
super(cause);
}
@java.io.Serial
static final long serialVersionUID = -2349421918363102232L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -40,6 +40,7 @@ package java.lang;
*/
public
class IllegalMonitorStateException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 3713306369498869069L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -93,5 +93,6 @@ class IllegalStateException extends RuntimeException {
super(cause);
}
@java.io.Serial
static final long serialVersionUID = -1848914673093119416L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -37,6 +37,7 @@ package java.lang;
* @since 1.0
*/
public class IllegalThreadStateException extends IllegalArgumentException {
@java.io.Serial
private static final long serialVersionUID = -7626246362397460174L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
*/
public
class IncompatibleClassChangeError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -4914975503642802119L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
* @since 1.0
*/
public class IndexOutOfBoundsException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 234122996006267687L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -40,6 +40,7 @@ package java.lang;
public
class InstantiationError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -4885810657349421204L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -44,6 +44,7 @@ package java.lang;
*/
public
class InstantiationException extends ReflectiveOperationException {
@java.io.Serial
private static final long serialVersionUID = -8441929162975509110L;
/**

View file

@ -1857,5 +1857,6 @@ public final class Integer extends Number
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
@Native private static final long serialVersionUID = 1360826667806852920L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -48,6 +48,7 @@ package java.lang;
*/
public
class InterruptedException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 6700697376100628473L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
* @spec JPMS
*/
public class LayerInstantiationException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -906239691613568347L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -36,6 +36,7 @@ package java.lang;
*/
public
class LinkageError extends Error {
@java.io.Serial
private static final long serialVersionUID = 3579600108157160122L;
/**

View file

@ -2000,5 +2000,6 @@ public final class Long extends Number
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
@Native private static final long serialVersionUID = 4290774380558885855L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
*/
public
class NegativeArraySizeException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -8960118058596991861L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -40,6 +40,7 @@ package java.lang;
*/
public
class NoClassDefFoundError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 9095859863287012458L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -38,6 +38,7 @@ package java.lang;
*/
public
class NoSuchFieldError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -3456430195886129035L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, 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
@ -32,6 +32,7 @@ package java.lang;
* @since 1.1
*/
public class NoSuchFieldException extends ReflectiveOperationException {
@java.io.Serial
private static final long serialVersionUID = -6143714805279938260L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -39,6 +39,7 @@ package java.lang;
*/
public
class NoSuchMethodError extends IncompatibleClassChangeError {
@java.io.Serial
private static final long serialVersionUID = -3765521442372831335L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
*/
public
class NoSuchMethodException extends ReflectiveOperationException {
@java.io.Serial
private static final long serialVersionUID = 5034388446362600923L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -51,6 +51,7 @@ package java.lang;
*/
public
class NullPointerException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 5162710183389028792L;
/**

View file

@ -119,5 +119,6 @@ public abstract class Number implements java.io.Serializable {
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -8742448824652078965L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -36,6 +36,7 @@ package java.lang;
*/
public
class NumberFormatException extends IllegalArgumentException {
@java.io.Serial
static final long serialVersionUID = -2848938806368998894L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -39,6 +39,7 @@ package java.lang;
* @since 1.0
*/
public class OutOfMemoryError extends VirtualMachineError {
@java.io.Serial
private static final long serialVersionUID = 8228564086184010517L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
* @since 1.7
*/
public class ReflectiveOperationException extends Exception {
@java.io.Serial
static final long serialVersionUID = 123456789L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -41,6 +41,7 @@ package java.lang;
* @since 1.0
*/
public class RuntimeException extends Exception {
@java.io.Serial
static final long serialVersionUID = -7034897190745766939L;
/** Constructs a new runtime exception with {@code null} as its

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, 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
@ -400,6 +400,7 @@ import java.lang.module.ModuleFinder;
public final class RuntimePermission extends BasicPermission {
@java.io.Serial
private static final long serialVersionUID = 7399184964622342223L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -33,6 +33,7 @@ package java.lang;
*/
public class SecurityException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 6878364983674394167L;
/**

View file

@ -579,5 +579,6 @@ public final class Short extends Number implements Comparable<Short> {
}
/** use serialVersionUID from JDK 1.1. for interoperability */
@java.io.Serial
private static final long serialVersionUID = 7515723908773894738L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -34,6 +34,7 @@ package java.lang;
*/
public
class StackOverflowError extends VirtualMachineError {
@java.io.Serial
private static final long serialVersionUID = 8609175038441759607L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2019, 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
@ -555,5 +555,6 @@ public final class StackTraceElement implements java.io.Serializable {
private static native void initStackTraceElement(StackTraceElement element,
StackFrameInfo sfi);
@java.io.Serial
private static final long serialVersionUID = 6992337162326171013L;
}

View file

@ -172,6 +172,7 @@ public final class String
private boolean hashIsZero; // Default to false;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -6849794470754667710L;
/**
@ -224,6 +225,7 @@ public final class String
* <a href="{@docRoot}/../specs/serialization/protocol.html#stream-elements">
* Object Serialization Specification, Section 6.2, "Stream Elements"</a>
*/
@java.io.Serial
private static final ObjectStreamField[] serialPersistentFields =
new ObjectStreamField[0];
@ -1235,6 +1237,7 @@ public final class String
private static class CaseInsensitiveComparator
implements Comparator<String>, java.io.Serializable {
// use serialVersionUID from JDK 1.2.2 for interoperability
@java.io.Serial
private static final long serialVersionUID = 8575799808933029326L;
public int compare(String s1, String s2) {
@ -1250,6 +1253,7 @@ public final class String
}
/** Replaces the de-serialized object. */
@java.io.Serial
private Object readResolve() { return CASE_INSENSITIVE_ORDER; }
}

View file

@ -115,6 +115,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
private transient String toStringCache;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
static final long serialVersionUID = 3388685877147921107L;
/**
@ -723,6 +724,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* A flag indicating whether the backing array is shared.
* The value is ignored upon deserialization.
*/
@java.io.Serial
private static final java.io.ObjectStreamField[] serialPersistentFields =
{
new java.io.ObjectStreamField("value", char[].class),
@ -734,6 +736,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* readObject is called to restore the state of the StringBuffer from
* a stream.
*/
@java.io.Serial
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
java.io.ObjectOutputStream.PutField fields = s.putFields();
@ -753,6 +756,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* readObject is called to restore the state of the StringBuffer from
* a stream.
*/
@java.io.Serial
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
java.io.ObjectInputStream.GetField fields = s.readFields();

View file

@ -88,6 +88,7 @@ public final class StringBuilder
{
/** use serialVersionUID for interoperability */
@java.io.Serial
static final long serialVersionUID = 4383685877147921099L;
/**
@ -458,6 +459,7 @@ public final class StringBuilder
* characters currently stored in the string builder, in which
* case extra characters are ignored.
*/
@java.io.Serial
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
s.defaultWriteObject();
@ -475,6 +477,7 @@ public final class StringBuilder
* readObject is called to restore the state of the StringBuffer from
* a stream.
*/
@java.io.Serial
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
* @since 1.0
*/
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
@java.io.Serial
private static final long serialVersionUID = -6762910422159637258L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -47,5 +47,6 @@ package java.lang;
*/
public class ThreadDeath extends Error {
@java.io.Serial
private static final long serialVersionUID = -4417128565033088268L;
}

View file

@ -114,6 +114,7 @@ import java.util.*;
*/
public class Throwable implements Serializable {
/** use serialVersionUID from JDK 1.0.2 for interoperability */
@java.io.Serial
private static final long serialVersionUID = -3042686055658047285L;
/**
@ -901,6 +902,7 @@ public class Throwable implements Serializable {
* cause} field can hold; both {@code null} and {@code this} are
* valid values for the field.
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
s.defaultReadObject(); // read in all fields
@ -989,6 +991,7 @@ public class Throwable implements Serializable {
* form as a one-element array whose element is equal to {@code
* new StackTraceElement("", "", null, Integer.MIN_VALUE)}.
*/
@java.io.Serial
private synchronized void writeObject(ObjectOutputStream s)
throws IOException {
// Ensure that the stackTrace field is initialized to a

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, 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
@ -44,6 +44,7 @@ package java.lang;
* @since 1.5
*/
public class TypeNotPresentException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -5101214195716534496L;
private String typeName;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -34,6 +34,7 @@ package java.lang;
*/
public
class UnknownError extends VirtualMachineError {
@java.io.Serial
private static final long serialVersionUID = 2524784860676771849L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
*/
public
class UnsatisfiedLinkError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = -4019343241616879428L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, 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
@ -34,6 +34,7 @@ package java.lang;
*/
public
class UnsupportedClassVersionError extends ClassFormatError {
@java.io.Serial
private static final long serialVersionUID = -7123279212883497373L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, 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
@ -90,5 +90,6 @@ public class UnsupportedOperationException extends RuntimeException {
super(cause);
}
@java.io.Serial
static final long serialVersionUID = -1242599979055084673L;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -35,6 +35,7 @@ package java.lang;
*/
public
class VerifyError extends LinkageError {
@java.io.Serial
private static final long serialVersionUID = 7001962396098498785L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, 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
@ -34,6 +34,7 @@ package java.lang;
* @since 1.0
*/
public abstract class VirtualMachineError extends Error {
@java.io.Serial
private static final long serialVersionUID = 4161983926571568670L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2019, 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
@ -37,6 +37,7 @@ package java.lang.annotation;
* @since 1.5
*/
public class AnnotationFormatError extends Error {
@java.io.Serial
private static final long serialVersionUID = -4256701562333669892L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, 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
@ -39,6 +39,7 @@ import java.lang.reflect.Method;
* @since 1.5
*/
public class AnnotationTypeMismatchException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 8125925355765570191L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, 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
@ -39,6 +39,7 @@ package java.lang.annotation;
* @since 1.5
*/
public class IncompleteAnnotationException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 8445097402741811912L;
private Class<? extends Annotation> annotationType;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, 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
@ -31,6 +31,7 @@ package java.lang.invoke;
* @since 1.8
*/
public class LambdaConversionException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 292L + 8L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2019, 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
@ -104,6 +104,7 @@ class MethodType
implements Constable,
TypeDescriptor.OfMethod<Class<?>, MethodType>,
java.io.Serializable {
@java.io.Serial
private static final long serialVersionUID = 292L; // {rtype, {ptype...}}
// The rtype and ptypes fields define the structural identity of the method type:
@ -1229,6 +1230,7 @@ class MethodType
/**
* There are no serializable fields for {@code MethodType}.
*/
@java.io.Serial
private static final java.io.ObjectStreamField[] serialPersistentFields = { };
/**
@ -1251,6 +1253,7 @@ s.writeObject(this.parameterArray());
* @param s the stream to write the object to
* @throws java.io.IOException if there is a problem writing the object
*/
@java.io.Serial
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject(); // requires serialPersistentFields to be an empty array
s.writeObject(returnType());
@ -1270,6 +1273,7 @@ s.writeObject(this.parameterArray());
* @see #readResolve
* @see #writeObject
*/
@java.io.Serial
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
// Assign temporary defaults in case this object escapes
MethodType_init(void.class, NO_PTYPES);
@ -1309,6 +1313,7 @@ s.writeObject(this.parameterArray());
* after serialization.
* @return the fully initialized {@code MethodType} object
*/
@java.io.Serial
private Object readResolve() {
// Do not use a trusted path for deserialization:
// return makeImpl(rtype, ptypes, true);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, 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
@ -65,6 +65,7 @@ import java.util.Objects;
* @since 1.8
*/
public final class SerializedLambda implements Serializable {
@java.io.Serial
private static final long serialVersionUID = 8025925345765570181L;
private final Class<?> capturingClass;
private final String functionalInterfaceClass;
@ -225,6 +226,7 @@ public final class SerializedLambda implements Serializable {
return capturedArgs[i];
}
@java.io.Serial
private Object readResolve() throws ObjectStreamException {
try {
Method deserialize = AccessController.doPrivileged(new PrivilegedExceptionAction<>() {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, 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
@ -32,6 +32,7 @@ package java.lang.invoke;
* @since 9
*/
public class StringConcatException extends Exception {
@java.io.Serial
private static final long serialVersionUID = 292L + 9L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2019, 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
@ -41,6 +41,7 @@ package java.lang.invoke;
* @since 1.7
*/
public class WrongMethodTypeException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = 292L;
/**

Some files were not shown because too many files have changed in this diff Show more