From 10b6766d4a11dd231831c20805e4ebe810714436 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 3 Jan 2003 17:00:03 +0000 Subject: 2003-01-03 Eric Blake * 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 --- libjava/java/util/TreeMap.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libjava/java/util/TreeMap.java') 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; -- cgit v1.2.3