aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/java/util/TreeMap.java
diff options
context:
space:
mode:
authordl <none@none>2010-12-01 21:46:52 +0000
committerdl <none@none>2010-12-01 21:46:52 +0000
commit97db506c8c18608860149e58d6ee898e86405af4 (patch)
treef2eaec66d3f2a3d0a6f7103a639b7a6d7e7ce318 /src/share/classes/java/util/TreeMap.java
parentd9039a4bd2e5d989c3ca07a2a0137a9788fdefa4 (diff)
downloadjdk8u_jdk-97db506c8c18608860149e58d6ee898e86405af4.tar.gz
7003745: Code style cleanups (sync from Dougs CVS)
Reviewed-by: chegar, dholmes
Diffstat (limited to 'src/share/classes/java/util/TreeMap.java')
-rw-r--r--src/share/classes/java/util/TreeMap.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/share/classes/java/util/TreeMap.java b/src/share/classes/java/util/TreeMap.java
index b0c9aa7d67..8c055d8ce9 100644
--- a/src/share/classes/java/util/TreeMap.java
+++ b/src/share/classes/java/util/TreeMap.java
@@ -1056,11 +1056,11 @@ public class TreeMap<K,V>
public Comparator<? super E> comparator() { return m.comparator(); }
public E pollFirst() {
Map.Entry<E,Object> e = m.pollFirstEntry();
- return e == null? null : e.getKey();
+ return (e == null) ? null : e.getKey();
}
public E pollLast() {
Map.Entry<E,Object> e = m.pollLastEntry();
- return e == null? null : e.getKey();
+ return (e == null) ? null : e.getKey();
}
public boolean remove(Object o) {
int oldSize = size();
@@ -1196,7 +1196,7 @@ public class TreeMap<K,V>
* Test two values for equality. Differs from o1.equals(o2) only in
* that it copes with {@code 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));
}
@@ -1204,7 +1204,7 @@ public class TreeMap<K,V>
* Return SimpleImmutableEntry for entry, or null if null
*/
static <K,V> Map.Entry<K,V> exportEntry(TreeMap.Entry<K,V> e) {
- return e == null? null :
+ return (e == null) ? null :
new AbstractMap.SimpleImmutableEntry<K,V>(e);
}
@@ -1212,7 +1212,7 @@ public class TreeMap<K,V>
* Return key for entry, or null if null
*/
static <K,V> K keyOrNull(TreeMap.Entry<K,V> e) {
- return e == null? null : e.key;
+ return (e == null) ? null : e.key;
}
/**
@@ -1237,7 +1237,7 @@ public class TreeMap<K,V>
/**
* @serial include
*/
- static abstract class NavigableSubMap<K,V> extends AbstractMap<K,V>
+ abstract static class NavigableSubMap<K,V> extends AbstractMap<K,V>
implements NavigableMap<K,V>, java.io.Serializable {
/**
* The backing map.
@@ -1412,11 +1412,11 @@ public class TreeMap<K,V>
}
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<K,V> ceilingEntry(K key) {
@@ -1559,7 +1559,8 @@ public class TreeMap<K,V>
if (!inRange(key))
return false;
TreeMap.Entry<K,V> 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;
}
@@ -1724,7 +1725,7 @@ public class TreeMap<K,V>
false, toKey, inclusive);
}
- public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive){
+ public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive) {
if (!inRange(fromKey, inclusive))
throw new IllegalArgumentException("fromKey out of range");
return new AscendingSubMap(m,
@@ -1805,7 +1806,7 @@ public class TreeMap<K,V>
toEnd, hi, hiInclusive);
}
- public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive){
+ public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive) {
if (!inRange(fromKey, inclusive))
throw new IllegalArgumentException("fromKey out of range");
return new DescendingSubMap(m,
@@ -2143,7 +2144,7 @@ public class TreeMap<K,V>
// If strictly internal, copy successor's element to p and then make p
// point to successor.
if (p.left != null && p.right != null) {
- Entry<K,V> s = successor (p);
+ Entry<K,V> s = successor(p);
p.key = s.key;
p.value = s.value;
p = s;