* java/util/TreeMap.java (nil): Made non-final.
(clone): Create new nil node for copy.
+
+ * java/util/HashSet.java (clone): Made subclass safe, use
+ super.clone(), not new.
2001-02-14 Andrew Haley <aph@redhat.com>
* HashSet is a part of the JDK1.2 Collections API.
*
* @author Jon Zeppieri
- * @version $Revision: 1.2 $
- * @modified $Id: HashSet.java,v 1.2 2001/02/14 04:44:21 bryce Exp $
+ * @version $Revision: 1.3 $
+ * @modified $Id: HashSet.java,v 1.3 2001/02/15 05:12:05 bryce Exp $
*/
public class HashSet extends AbstractSet
implements Set, Cloneable, Serializable
*/
public Object clone()
{
- HashSet copy = new HashSet();
+ HashSet copy = null;
+ try
+ {
+ copy = (HashSet) super.clone();
+ }
+ catch (CloneNotSupportedException x)
+ {
+ }
copy.map = (HashMap) map.clone();
return copy;
}