< prev index next >
src/java.base/share/classes/java/util/TreeMap.java
Print this page
*** 1337,1346 ****
--- 1337,1347 ----
/**
* @serial include
*/
abstract static class NavigableSubMap<K,V> extends AbstractMap<K,V>
implements NavigableMap<K,V>, java.io.Serializable {
+ @java.io.Serial
private static final long serialVersionUID = -2102997345730753016L;
/**
* The backing map.
*/
final TreeMap<K,V> m;
*** 1842,1851 ****
--- 1843,1853 ----
/**
* @serial include
*/
static final class AscendingSubMap<K,V> extends NavigableSubMap<K,V> {
+ @java.io.Serial
private static final long serialVersionUID = 912986545866124060L;
AscendingSubMap(TreeMap<K,V> m,
boolean fromStart, K lo, boolean loInclusive,
boolean toEnd, K hi, boolean hiInclusive) {
*** 1925,1934 ****
--- 1927,1937 ----
/**
* @serial include
*/
static final class DescendingSubMap<K,V> extends NavigableSubMap<K,V> {
+ @java.io.Serial
private static final long serialVersionUID = 912986545866120460L;
DescendingSubMap(TreeMap<K,V> m,
boolean fromStart, K lo, boolean loInclusive,
boolean toEnd, K hi, boolean hiInclusive) {
super(m, fromStart, lo, loInclusive, toEnd, hi, hiInclusive);
*** 2017,2029 ****
--- 2020,2034 ----
*
* @serial include
*/
private class SubMap extends AbstractMap<K,V>
implements SortedMap<K,V>, 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,
toEnd, toKey, false);
}
*** 2404,2413 ****
--- 2409,2419 ----
}
setColor(x, BLACK);
}
+ @java.io.Serial
private static final long serialVersionUID = 919286545866124006L;
/**
* Save the state of the {@code TreeMap} instance to a stream (i.e.,
* serialize it).
*** 2418,2427 ****
--- 2424,2434 ----
* by the TreeMap. The key-value mappings are emitted in
* key-order (as determined by the TreeMap's Comparator,
* 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
s.defaultWriteObject();
*** 2437,2446 ****
--- 2444,2454 ----
/**
* 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
s.defaultReadObject();
< prev index next >