--- old/src/java.base/share/classes/java/util/TreeMap.java 2019-08-27 17:29:14.402324386 -0700 +++ new/src/java.base/share/classes/java/util/TreeMap.java 2019-08-27 17:29:14.186324386 -0700 @@ -1339,6 +1339,7 @@ */ abstract static class NavigableSubMap extends AbstractMap implements NavigableMap, java.io.Serializable { + @java.io.Serial private static final long serialVersionUID = -2102997345730753016L; /** * The backing map. @@ -1844,6 +1845,7 @@ * @serial include */ static final class AscendingSubMap extends NavigableSubMap { + @java.io.Serial private static final long serialVersionUID = 912986545866124060L; AscendingSubMap(TreeMap m, @@ -1927,6 +1929,7 @@ * @serial include */ static final class DescendingSubMap extends NavigableSubMap { + @java.io.Serial private static final long serialVersionUID = 912986545866120460L; DescendingSubMap(TreeMap m, boolean fromStart, K lo, boolean loInclusive, @@ -2019,9 +2022,11 @@ */ private class SubMap extends AbstractMap implements SortedMap, java.io.Serializable { + @java.io.Serial private static final long serialVersionUID = -6520786458950516097L; private boolean fromStart = false, toEnd = false; private K fromKey, toKey; + @java.io.Serial private Object readResolve() { return new AscendingSubMap<>(TreeMap.this, fromStart, fromKey, true, @@ -2406,7 +2411,8 @@ setColor(x, BLACK); } - private static final long serialVersionUID = 919286545866124006L; + @java.io.Serial + private static final long serialVersionUID = 919286545866124006L; /** * Save the state of the {@code TreeMap} instance to a stream (i.e., @@ -2420,6 +2426,7 @@ * or by the keys' natural ordering if the TreeMap has no * Comparator). */ + @java.io.Serial private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { // Write out the Comparator and any hidden stuff @@ -2439,6 +2446,7 @@ * Reconstitute the {@code TreeMap} instance from a stream (i.e., * deserialize it). */ + @java.io.Serial private void readObject(final java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { // Read in the Comparator and any hidden stuff