summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2002-05-03 04:25:24 +0000
committerEric Blake <ebb9@byu.net>2002-05-03 04:25:24 +0000
commit4a7f87494e470c17f627e844b76ab2d78cbca9e8 (patch)
tree85ddd0cdea7e6bf1e2f4ab7601e43350e719072f /java
parent07227f64993e98187bec0649642d4fd1dfca6277 (diff)
downloadclasspath-4a7f87494e470c17f627e844b76ab2d78cbca9e8.tar.gz
2002-05-02 Eric Blake <ebb9@email.byu.edu>
* java/util/TreeMap.java (remove): Fix improper return value. * THANKYOU: Add Xuan Baldauf for spotting this.
Diffstat (limited to 'java')
-rw-r--r--java/util/TreeMap.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/util/TreeMap.java b/java/util/TreeMap.java
index e530a9487..dfa9bc638 100644
--- a/java/util/TreeMap.java
+++ b/java/util/TreeMap.java
@@ -623,8 +623,10 @@ public class TreeMap extends AbstractMap
Node n = getNode(key);
if (n == nil)
return null;
+ // Note: removeNode can alter the contents of n, so save value now.
+ Object result = n.value;
removeNode(n);
- return n.value;
+ return result;
}
/**
@@ -1768,7 +1770,7 @@ public class TreeMap extends AbstractMap
SubMap.this.clear();
}
};
- return this.keys;
+ return this.values;
}
} // class SubMap
} // class TreeMap