--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/HttpHeadersImpl.java Mon Feb 05 19:01:54 2018 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/HttpHeadersImpl.java Mon Feb 05 19:09:31 2018 +0000
@@ -53,11 +53,9 @@
public HttpHeadersImpl deepCopy() {
HttpHeadersImpl h1 = new HttpHeadersImpl();
- Set<String> keys = headers.keySet();
- for (String key : keys) {
- List<String> vals = headers.get(key);
- List<String> vals1 = new ArrayList<>(vals);
- h1.headers.put(key, vals1);
+ for (Map.Entry<String,List<String>> entry : headers.entrySet()) {
+ List<String> valuesCopy = new ArrayList<>(entry.getValue());
+ h1.headers.put(entry.getKey(), valuesCopy);
}
return h1;
}