jdk/src/share/classes/java/util/Map.java
changeset 20189 1e618f2a82d9
parent 19855 bfe130545fe0
child 20491 eb2dfc7436af
--- a/jdk/src/share/classes/java/util/Map.java	Fri Sep 20 11:07:06 2013 -0700
+++ b/jdk/src/share/classes/java/util/Map.java	Fri Sep 20 15:12:05 2013 -0700
@@ -934,6 +934,7 @@
      */
     default V computeIfAbsent(K key,
             Function<? super K, ? extends V> mappingFunction) {
+        Objects.requireNonNull(mappingFunction);
         V v, newValue;
         return ((v = get(key)) == null &&
                 (newValue = mappingFunction.apply(key)) != null &&
@@ -992,6 +993,7 @@
      */
     default V computeIfPresent(K key,
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
         V oldValue;
         while ((oldValue = get(key)) != null) {
             V newValue = remappingFunction.apply(key, oldValue);
@@ -1068,6 +1070,7 @@
      */
     default V compute(K key,
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
         for (;;) {
             V newValue = remappingFunction.apply(key, oldValue);
@@ -1174,6 +1177,7 @@
      */
     default V merge(K key, V value,
             BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
+        Objects.requireNonNull(remappingFunction);
         V oldValue = get(key);
         for (;;) {
             if (oldValue != null) {