src/share/classes/java/util/concurrent/ConcurrentMap.java

Print this page
rev 8834 : 8029055: Map.merge implementations should refuse null value param
Reviewed-by: duke

@@ -461,22 +461,20 @@
 
     /**
      * {@inheritDoc}
      *
      * @implSpec
-     * The default implementation is equivalent to performing the
-     * following steps for this {@code map}, then returning the
-     * current value or {@code null} if absent:
+     * The default implementation is equivalent to performing the following
+     * steps for this {@code map}, then returning the current value or
+     * {@code null} if absent:
      *
      * <pre> {@code
      * V oldValue = map.get(key);
      * V newValue = (oldValue == null) ? value :
      *              remappingFunction.apply(oldValue, value);
      * if (newValue == null)
      *     map.remove(key);
-     * else if (oldValue == null)
-     *     map.remove(key);
      * else
      *     map.put(key, newValue);
      * }</pre>
      *
      * <p>The default implementation may retry these steps when multiple