src/share/classes/java/util/TreeMap.java

Print this page
rev 3503 : [mq]: cr5045147

*** 526,540 **** * does not permit null keys */ public V put(K key, V value) { Entry<K,V> t = root; if (t == null) { ! // TBD: ! // 5045147: (coll) Adding null to an empty TreeSet should ! // throw NullPointerException ! // ! // compare(key, key); // type check root = new Entry<>(key, value, null); size = 1; modCount++; return null; } --- 526,537 ---- * does not permit null keys */ public V put(K key, V value) { Entry<K,V> t = root; if (t == null) { ! compare(key, key); // type (and possibly null) check ! root = new Entry<>(key, value, null); size = 1; modCount++; return null; }