--- jsr166/src/main/java/util/TreeMap.java 2005/06/24 20:44:49 1.22 +++ jsr166/src/main/java/util/TreeMap.java 2005/07/18 01:14:34 1.23 @@ -31,19 +31,19 @@ import java.util.*; // for javadoc (till * is well-defined even if its ordering is inconsistent with equals; it * just fails to obey the general contract of the Map interface. * - *

Note that this implementation is not synchronized. If multiple - * threads access a map concurrently, and at least one of the threads modifies - * the map structurally, it must be synchronized externally. (A - * structural modification is any operation that adds or deletes one or more - * mappings; merely changing the value associated with an existing key is not - * a structural modification.) This is typically accomplished by - * synchronizing on some object that naturally encapsulates the map. If no - * such object exists, the map should be "wrapped" using the - * Collections.synchronizedMap method. This is best done at creation - * time, to prevent accidental unsynchronized access to the map: - *

- *     Map m = Collections.synchronizedMap(new TreeMap(...));
- * 
+ *

Note that this implementation is not synchronized. + * If multiple threads access a map concurrently, and at least one of the + * threads modifies the map structurally, it must be synchronized + * externally. (A structural modification is any operation that adds or + * deletes one or more mappings; merely changing the value associated + * with an existing key is not a structural modification.) This is + * typically accomplished by synchronizing on some object that naturally + * encapsulates the map. + * If no such object exists, the map should be "wrapped" using the + * {@link Collections#synchronizedSortedMap Collections.synchronizedSortedMap} + * method. This is best done at creation time, to prevent accidental + * unsynchronized access to the map:

+ *   SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));
* *

The iterators returned by the iterator method of the collections * returned by all of this class's "collection view methods" are @@ -83,7 +83,6 @@ import java.util.*; // for javadoc (till * @see Comparable * @see Comparator * @see Collection - * @see Collections#synchronizedMap(Map) * @since 1.2 */ @@ -541,11 +540,12 @@ public class TreeMap Entry t = root; if (t == null) { - if (key == null) { - if (comparator == null) - throw new NullPointerException(); - comparator.compare(key, key); - } + // TBD +// if (key == null) { +// if (comparator == null) +// throw new NullPointerException(); +// comparator.compare(key, key); +// } incrementSize(); root = new Entry(key, value, null); return null;