Code Review
/
netconf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Simplify code using Java 8 features
[netconf.git]
/
restconf
/
restconf-common
/
src
/
main
/
java
/
org
/
opendaylight
/
restconf
/
common
/
util
/
MultivaluedHashMap.java
diff --git
a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/MultivaluedHashMap.java
b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/MultivaluedHashMap.java
index 1036757f498ef4957da1daf40ca19522914f1f7c..4eedb93245726b268e183bb1d26eee4962ed75bb 100644
(file)
--- a/
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/MultivaluedHashMap.java
+++ b/
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/util/MultivaluedHashMap.java
@@
-177,12
+177,6
@@
public class MultivaluedHashMap<K, V> implements MultivaluedMap<K, V> {
}
private List<V> getValues(K key) {
- List<V> list = store.get(key);
- if (list == null) {
- list = new LinkedList<>();
- store.put(key, list);
- }
-
- return list;
+ return store.computeIfAbsent(key, k -> new LinkedList<>());
}
}