This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
java.util.TreeMap patch
- From: Eric Blake <ebb9 at email dot byu dot edu>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 21 Dec 2002 14:20:51 -0700
- Subject: java.util.TreeMap patch
Do I have permission to apply this patch to the trunk and 3.3 branch? I
just applied this to Classpath.
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.
Index: java/util/TreeMap.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/TreeMap.java,v
retrieving revision 1.8
diff -u -r1.8 TreeMap.java
--- java/util/TreeMap.java 18 Jun 2002 15:40:02 -0000 1.8
+++ java/util/TreeMap.java 21 Dec 2002 21:17:48 -0000
@@ -865,7 +865,7 @@
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 void remove()
{
- if (knownMod != modCount)
- throw new ConcurrentModificationException();
if (last == null)
throw new IllegalStateException();
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
removeNode(last);
last = null;
--
This signature intentionally left boring.
Eric Blake ebb9@email.byu.edu
BYU student, free software programmer