diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-03 17:00:03 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-03 17:00:03 +0000 |
commit | 10b6766d4a11dd231831c20805e4ebe810714436 (patch) | |
tree | 4988d3eef804270ab6af5a8259a83d2aec547516 /libjava/java/util/TreeMap.java | |
parent | 41ed3bcd59cf3b4411de67081e57e8f62bdc5c78 (diff) | |
download | ppe42-gcc-10b6766d4a11dd231831c20805e4ebe810714436.tar.gz ppe42-gcc-10b6766d4a11dd231831c20805e4ebe810714436.zip |
2003-01-03 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60837 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/TreeMap.java')
-rw-r--r-- | libjava/java/util/TreeMap.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java index dfa9bc63881..e0cff28e02c 100644 --- a/libjava/java/util/TreeMap.java +++ b/libjava/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; |