[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] TreeMap serialization bug fix (bug #10383)
From: |
Mark Wielaard |
Subject: |
[cp-patches] TreeMap serialization bug fix (bug #10383) |
Date: |
Sun, 19 Sep 2004 22:16:51 +0200 |
Hi,
This fixes bug #10383 by consistently initializing node and size.
2004-09-19 Mark Wielaard <address@hidden>
Fixes reported by Ilya Perminov.
* java/util/TreeMap.java (root): Don't initialize.
(TreeMap(Comparator)): Call fabricateTree(0).
(fabricateTree): Initialize root and size when count is 0.
The mauve test that David wrote for this passes now.
Committed,
Mark
Index: java/util/TreeMap.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/TreeMap.java,v
retrieving revision 1.23
diff -u -r1.23 TreeMap.java
--- java/util/TreeMap.java 22 Apr 2004 11:24:39 -0000 1.23
+++ java/util/TreeMap.java 19 Sep 2004 20:16:14 -0000
@@ -130,7 +130,7 @@
/**
* The root node of this TreeMap.
*/
- private transient Node root = nil;
+ private transient Node root;
/**
* The size of this TreeMap. Package visible for use by nested classes.
@@ -213,6 +213,7 @@
public TreeMap(Comparator c)
{
comparator = c;
+ fabricateTree(0);
}
/**
@@ -851,7 +852,11 @@
private void fabricateTree(final int count)
{
if (count == 0)
- return;
+ {
+ root = nil;
+ size = 0;
+ return;
+ }
// We color every row of nodes black, except for the overflow nodes.
// I believe that this is the optimal arrangement. We construct the tree
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] TreeMap serialization bug fix (bug #10383),
Mark Wielaard <=