--- jsr166/src/main/java/util/TreeMap.java 2010/09/01 07:48:47 1.49 +++ jsr166/src/main/java/util/TreeMap.java 2010/10/22 05:18:30 1.53 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -18,9 +18,9 @@ * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ package java.util; @@ -1055,11 +1055,11 @@ public class TreeMap public Comparator comparator() { return m.comparator(); } public E pollFirst() { Map.Entry e = m.pollFirstEntry(); - return e == null? null : e.getKey(); + return (e == null) ? null : e.getKey(); } public E pollLast() { Map.Entry e = m.pollLastEntry(); - return e == null? null : e.getKey(); + return (e == null) ? null : e.getKey(); } public boolean remove(Object o) { int oldSize = size(); @@ -1195,7 +1195,7 @@ public class TreeMap * Test two values for equality. Differs from o1.equals(o2) only in * that it copes with null o1 properly. */ - final static boolean valEquals(Object o1, Object o2) { + static final boolean valEquals(Object o1, Object o2) { return (o1==null ? o2==null : o1.equals(o2)); } @@ -1203,7 +1203,7 @@ public class TreeMap * Return SimpleImmutableEntry for entry, or null if null */ static Map.Entry exportEntry(TreeMap.Entry e) { - return e == null? null : + return (e == null) ? null : new AbstractMap.SimpleImmutableEntry(e); } @@ -1211,7 +1211,7 @@ public class TreeMap * Return key for entry, or null if null */ static K keyOrNull(TreeMap.Entry e) { - return e == null? null : e.key; + return (e == null) ? null : e.key; } /** @@ -1236,7 +1236,7 @@ public class TreeMap /** * @serial include */ - static abstract class NavigableSubMap extends AbstractMap + abstract static class NavigableSubMap extends AbstractMap implements NavigableMap, java.io.Serializable { /** * The backing map. @@ -1411,11 +1411,11 @@ public class TreeMap } public final V get(Object key) { - return !inRange(key)? null : m.get(key); + return !inRange(key) ? null : m.get(key); } public final V remove(Object key) { - return !inRange(key)? null : m.remove(key); + return !inRange(key) ? null : m.remove(key); } public final Map.Entry ceilingEntry(K key) { @@ -1558,7 +1558,8 @@ public class TreeMap if (!inRange(key)) return false; TreeMap.Entry node = m.getEntry(key); - if (node!=null && valEquals(node.getValue(),entry.getValue())){ + if (node!=null && valEquals(node.getValue(), + entry.getValue())) { m.deleteEntry(node); return true; } @@ -1723,7 +1724,7 @@ public class TreeMap false, toKey, inclusive); } - public NavigableMap tailMap(K fromKey, boolean inclusive){ + public NavigableMap tailMap(K fromKey, boolean inclusive) { if (!inRange(fromKey, inclusive)) throw new IllegalArgumentException("fromKey out of range"); return new AscendingSubMap(m, @@ -1804,7 +1805,7 @@ public class TreeMap toEnd, hi, hiInclusive); } - public NavigableMap tailMap(K fromKey, boolean inclusive){ + public NavigableMap tailMap(K fromKey, boolean inclusive) { if (!inRange(fromKey, inclusive)) throw new IllegalArgumentException("fromKey out of range"); return new DescendingSubMap(m,