2004-09-21 Mark Wielaard <mark@klomp.org>
* java/util/TreeMap.java (root): Don't initialize.
(TreeMap(Comparator)): Call fabricateTree(0).
(fabricateTree): Initialize root and size when count is 0.
From-SVN: r87811
/**
* 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.
public TreeMap(Comparator c)
{
comparator = c;
+ fabricateTree(0);
}
/**
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