--- old/src/share/classes/java/util/TreeMap.java 2011-03-10 15:50:01.000000000 -0800 +++ new/src/share/classes/java/util/TreeMap.java 2011-03-10 15:50:01.000000000 -0800 @@ -528,11 +528,12 @@ public V put(K key, V value) { Entry t = root; if (t == null) { - // TBD: - // 5045147: (coll) Adding null to an empty TreeSet should - // throw NullPointerException - // - // compare(key, key); // type check + if (key == null) { + if (comparator == null) { + throw new NullPointerException(); + } + comparator.compare(key, key); // type check + } root = new Entry<>(key, value, null); size = 1; modCount++;