Use Map#forEach instead of Map#entrySet#forEach

See gh-1449
This commit is contained in:
diguage
2017-06-05 16:39:28 +08:00
committed by Stephane Nicoll
parent 424bc75fb1
commit 2efa06237a
10 changed files with 38 additions and 39 deletions

View File

@@ -195,8 +195,7 @@ public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializa
*/
public LinkedMultiValueMap<K, V> deepCopy() {
LinkedMultiValueMap<K, V> copy = new LinkedMultiValueMap<>(this.targetMap.size());
this.targetMap.entrySet().forEach(entry ->
copy.put(entry.getKey(), new LinkedList<>(entry.getValue())));
this.targetMap.forEach((k, v) -> copy.put(k, new LinkedList<>(v)));
return copy;
}