ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/TreeMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/TreeMap.java (file contents):
Revision 1.49 by jsr166, Wed Sep 1 07:48:47 2010 UTC vs.
Revision 1.52 by jsr166, Sat Oct 16 16:44:39 2010 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
2 > * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5   * This code is free software; you can redistribute it and/or modify it
# Line 18 | Line 18
18   * 2 along with this work; if not, write to the Free Software Foundation,
19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20   *
21 < * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 < * CA 95054 USA or visit www.sun.com if you need additional information or
23 < * have any questions.
21 > * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 > * or visit www.oracle.com if you need additional information or have any
23 > * questions.
24   */
25  
26   package java.util;
# Line 1195 | Line 1195 | public class TreeMap<K,V>
1195       * Test two values for equality.  Differs from o1.equals(o2) only in
1196       * that it copes with <tt>null</tt> o1 properly.
1197       */
1198 <    final static boolean valEquals(Object o1, Object o2) {
1198 >    static final boolean valEquals(Object o1, Object o2) {
1199          return (o1==null ? o2==null : o1.equals(o2));
1200      }
1201  
# Line 1236 | Line 1236 | public class TreeMap<K,V>
1236      /**
1237       * @serial include
1238       */
1239 <    static abstract class NavigableSubMap<K,V> extends AbstractMap<K,V>
1239 >    abstract static class NavigableSubMap<K,V> extends AbstractMap<K,V>
1240          implements NavigableMap<K,V>, java.io.Serializable {
1241          /**
1242           * The backing map.
# Line 1558 | Line 1558 | public class TreeMap<K,V>
1558                  if (!inRange(key))
1559                      return false;
1560                  TreeMap.Entry<K,V> node = m.getEntry(key);
1561 <                if (node!=null && valEquals(node.getValue(),entry.getValue())){
1561 >                if (node!=null && valEquals(node.getValue(),
1562 >                                            entry.getValue())) {
1563                      m.deleteEntry(node);
1564                      return true;
1565                  }
# Line 1723 | Line 1724 | public class TreeMap<K,V>
1724                                         false,     toKey, inclusive);
1725          }
1726  
1727 <        public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive){
1727 >        public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive) {
1728              if (!inRange(fromKey, inclusive))
1729                  throw new IllegalArgumentException("fromKey out of range");
1730              return new AscendingSubMap(m,
# Line 1804 | Line 1805 | public class TreeMap<K,V>
1805                                          toEnd, hi,    hiInclusive);
1806          }
1807  
1808 <        public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive){
1808 >        public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive) {
1809              if (!inRange(fromKey, inclusive))
1810                  throw new IllegalArgumentException("fromKey out of range");
1811              return new DescendingSubMap(m,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines