--- old/src/java.base/share/classes/java/util/EnumSet.java 2019-08-27 17:28:54.894324386 -0700 +++ new/src/java.base/share/classes/java/util/EnumSet.java 2019-08-27 17:28:54.698324386 -0700 @@ -80,6 +80,7 @@ implements Cloneable, java.io.Serializable { // declare EnumSet.class serialization compatibility with JDK 8 + @java.io.Serial private static final long serialVersionUID = 1009687484059888093L; /** @@ -449,6 +450,7 @@ * held by this proxy */ @SuppressWarnings("unchecked") + @java.io.Serial private Object readResolve() { // instead of cast to E, we should perhaps use elementType.cast() // to avoid injection of forged stream, but it will slow the @@ -459,6 +461,7 @@ return result; } + @java.io.Serial private static final long serialVersionUID = 362491234563181265L; } @@ -471,6 +474,7 @@ * @return a {@link SerializationProxy} * representing the state of this instance */ + @java.io.Serial Object writeReplace() { return new SerializationProxy<>(this); } @@ -479,6 +483,7 @@ * @param s the stream * @throws java.io.InvalidObjectException always */ + @java.io.Serial private void readObject(java.io.ObjectInputStream s) throws java.io.InvalidObjectException { throw new java.io.InvalidObjectException("Proxy required");