From: bryce Date: Fri, 16 Feb 2001 02:25:24 +0000 (+0000) Subject: * java/util/TreeMap.java (nil): Made non-final. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=09a084c518e228f35bc37f0710338f5b623080e0;p=pf3gnuchains%2Fgcc-fork.git * java/util/TreeMap.java (nil): Made non-final. (clone): Create new nil node for copy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39736 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 63b9840387d..f3b77a166c2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -3,6 +3,9 @@ * java/util/TreeSet.java (clone): Made subclass safe, use super.clone(), not new. * java/util/TreeMap.java (clone): Likewise. + + * java/util/TreeMap.java (nil): Made non-final. + (clone): Create new nil node for copy. 2001-02-14 Andrew Haley diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java index 67ecebdaff1..26e3fd6dfba 100644 --- a/libjava/java/util/TreeMap.java +++ b/libjava/java/util/TreeMap.java @@ -56,7 +56,7 @@ import java.io.IOException; * * @author Jon Zeppieri * @author Bryce McKinlay - * @modified $Id: TreeMap.java,v 1.2 2001/02/14 05:32:31 bryce Exp $ + * @modified $Id: TreeMap.java,v 1.3 2001/02/16 01:49:40 bryce Exp $ */ public class TreeMap extends AbstractMap implements SortedMap, Cloneable, Serializable @@ -67,7 +67,7 @@ public class TreeMap extends AbstractMap /** Sentinal node, used to avoid null checks for corner cases and make the delete rebalance code simpler. Note that this must not be static, due to thread-safety concerns. */ - transient final Node nil = new Node(null, null); + transient Node nil = new Node(null, null); /** The root node of this TreeMap */ transient Node root = nil; @@ -186,6 +186,8 @@ public class TreeMap extends AbstractMap catch (CloneNotSupportedException x) { } + // Each instance must have a unique sentinal. + copy.nil = new Node(null, null); copy.fabricateTree(size); Node node = firstNode();