ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/HashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/HashMap.java (file contents):
Revision 1.5 by jsr166, Tue May 22 16:16:57 2018 UTC vs.
Revision 1.8 by jsr166, Mon Oct 1 00:10:53 2018 UTC

# Line 118 | Line 118 | import jdk.internal.misc.SharedSecrets;
118   * should be used only to detect bugs.</i>
119   *
120   * <p>This class is a member of the
121 < * <a href="{@docRoot}/java/util/package-summary.html#CollectionsFramework">
121 > * <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
122   * Java Collections Framework</a>.
123   *
124   * @param <K> the type of keys maintained by this map
# Line 1263 | Line 1263 | public class HashMap<K,V> extends Abstra
1263      @Override
1264      public V merge(K key, V value,
1265                     BiFunction<? super V, ? super V, ? extends V> remappingFunction) {
1266 <        if (value == null)
1267 <            throw new NullPointerException();
1268 <        if (remappingFunction == null)
1266 >        if (value == null || remappingFunction == null)
1267              throw new NullPointerException();
1268          int hash = hash(key);
1269          Node<K,V>[] tab; Node<K,V> first; int n, i;
# Line 1308 | Line 1306 | public class HashMap<K,V> extends Abstra
1306              else
1307                  removeNode(hash, key, null, false, true);
1308              return v;
1309 <        }
1312 <        if (value != null) {
1309 >        } else {
1310              if (t != null)
1311                  t.putTreeVal(this, tab, hash, key, value);
1312              else {
# Line 1320 | Line 1317 | public class HashMap<K,V> extends Abstra
1317              ++modCount;
1318              ++size;
1319              afterNodeInsertion(true);
1320 +            return value;
1321          }
1324        return value;
1322      }
1323  
1324      @Override
# Line 2148 | Line 2145 | public class HashMap<K,V> extends Abstra
2145              if (replacement != p) {
2146                  TreeNode<K,V> pp = replacement.parent = p.parent;
2147                  if (pp == null)
2148 <                    root = replacement;
2148 >                    (root = replacement).red = false;
2149                  else if (p == pp.left)
2150                      pp.left = replacement;
2151                  else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines