--- old/src/java.base/share/classes/java/lang/ClassNotFoundException.java 2019-08-27 17:27:07.018324386 -0700 +++ new/src/java.base/share/classes/java/lang/ClassNotFoundException.java 2019-08-27 17:27:06.786324386 -0700 @@ -59,6 +59,7 @@ /** * use serialVersionUID from JDK 1.1.X for interoperability */ + @java.io.Serial private static final long serialVersionUID = 9176873029745254542L; /** @@ -111,6 +112,7 @@ * * @serialField ex Throwable */ + @java.io.Serial private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("ex", Throwable.class) }; @@ -124,6 +126,7 @@ * 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 @@ * 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());