Skip to content

Commit

Permalink
SAK-26078 jdk 8 updates to Maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ern committed Mar 16, 2015
1 parent 3a81ea9 commit 4b33c37
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Expand Up @@ -120,6 +120,13 @@ public V put(K key, V value) {
return v;
}

@Override
public void putAll(Map<? extends K, ? extends V> m) {
for (Map.Entry<? extends K, ? extends V> entry : m.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}

@Override
public V remove(Object key) {
V v = super.remove(key);
Expand Down
Expand Up @@ -116,6 +116,11 @@ public V get(Object key) {
}

@Override
public boolean containsKey(Object key) {
return super.get(key) != null;
}

@Override
public V put(K key, V value) {
value = fixNullIn(value);
V v = super.put(key, value);
Expand All @@ -128,6 +133,13 @@ public V put(K key, V value) {
}

@Override
public void putAll(Map<? extends K, ? extends V> m) {
for (Map.Entry<? extends K, ? extends V> entry : m.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}

@Override
public V putIfAbsent(K key, V value) {
if (! containsKey(key))
return put(key, value);
Expand Down

0 comments on commit 4b33c37

Please sign in to comment.