diff options
author | Eric Blake <ebb9@byu.net> | 2002-12-21 20:15:08 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2002-12-21 20:15:08 +0000 |
commit | 6923273bdd03b585338096b7a71c354523a66400 (patch) | |
tree | adb6b0817d3d64d98eb45c086e3b8da77a09bbf0 | |
parent | d6a8938bae94d3f9e9755be5fca0e4bfadd58e8f (diff) | |
download | classpath-6923273bdd03b585338096b7a71c354523a66400.tar.gz |
2002-12-21 Eric Blake <ebb9@email.byu.edu>
* java/util/TreeMap.java (fabricateTree): Fix off-by-one error.
(TreeIterator.remove): Prefer IllegalStateException over
ConcurrentModificationException, to match Sun.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | java/util/TreeMap.java | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2002-12-21 Eric Blake <ebb9@email.byu.edu> + + * java/util/TreeMap.java (fabricateTree): Fix off-by-one error. + (TreeIterator.remove): Prefer IllegalStateException over + ConcurrentModificationException, to match Sun. + 2002-12-21 Michael Koch <konqueror@gmx.de> * java/nio/channels/FileChannel.java diff --git a/java/util/TreeMap.java b/java/util/TreeMap.java index dfa9bc638..e0cff28e0 100644 --- a/java/util/TreeMap.java +++ b/java/util/TreeMap.java @@ -865,7 +865,7 @@ public class TreeMap extends AbstractMap int rowsize; // Fill each row that is completely full of nodes. - for (rowsize = 2; rowsize + rowsize < count; rowsize <<= 1) + for (rowsize = 2; rowsize + rowsize <= count; rowsize <<= 1) { Node parent = row; Node last = null; @@ -1468,10 +1468,10 @@ public class TreeMap extends AbstractMap */ public void remove() { - if (knownMod != modCount) - throw new ConcurrentModificationException(); if (last == null) throw new IllegalStateException(); + if (knownMod != modCount) + throw new ConcurrentModificationException(); removeNode(last); last = null; |