< prev index next >

src/java.base/share/classes/java/util/TreeMap.java

Print this page

        

*** 116,125 **** --- 116,126 ---- * The comparator used to maintain order in this tree map, or * null if it uses the natural ordering of its keys. * * @serial */ + @SuppressWarnings("serial") // Not statically typed as Serializable private final Comparator<? super K> comparator; private transient Entry<K,V> root; /**
*** 1351,1361 **** * true, then the low (absolute) bound is the start of the * backing map, and the other values are ignored. Otherwise, * if loInclusive is true, lo is the inclusive bound, else lo * is the exclusive bound. Similarly for the upper bound. */ ! final K lo, hi; final boolean fromStart, toEnd; final boolean loInclusive, hiInclusive; NavigableSubMap(TreeMap<K,V> m, boolean fromStart, K lo, boolean loInclusive, --- 1352,1365 ---- * true, then the low (absolute) bound is the start of the * backing map, and the other values are ignored. Otherwise, * if loInclusive is true, lo is the inclusive bound, else lo * is the exclusive bound. Similarly for the upper bound. */ ! @SuppressWarnings("serial") // Not statically typed as Serializable ! final K lo; ! @SuppressWarnings("serial") // Not statically typed as Serializable ! final K hi; final boolean fromStart, toEnd; final boolean loInclusive, hiInclusive; NavigableSubMap(TreeMap<K,V> m, boolean fromStart, K lo, boolean loInclusive,
*** 1934,1943 **** --- 1938,1948 ---- boolean fromStart, K lo, boolean loInclusive, boolean toEnd, K hi, boolean hiInclusive) { super(m, fromStart, lo, loInclusive, toEnd, hi, hiInclusive); } + @SuppressWarnings("serial") // Not statically typed as Serializable private final Comparator<? super K> reverseComparator = Collections.reverseOrder(m.comparator); public Comparator<? super K> comparator() { return reverseComparator;
*** 2022,2032 **** 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); --- 2027,2040 ---- 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; ! @SuppressWarnings("serial") // Not statically typed as Serializable ! private K fromKey; ! @SuppressWarnings("serial") // Not statically typed as Serializable ! private K toKey; @java.io.Serial private Object readResolve() { return new AscendingSubMap<>(TreeMap.this, fromStart, fromKey, true, toEnd, toKey, false);
< prev index next >