< prev index next >
src/java.base/share/classes/sun/net/www/MessageHeader.java
Print this page
@@ -242,11 +242,11 @@
}
public synchronized Map<String, List<String>> filterAndAddHeaders(
String[] excludeList, Map<String, List<String>> include) {
boolean skipIt = false;
- Map<String, List<String>> m = new HashMap<String, List<String>>();
+ Map<String, List<String>> m = new HashMap<>();
for (int i = nkeys; --i >= 0;) {
if (excludeList != null) {
// check if the key is in the excludeList.
// if so, don't include it in the Map.
for (int j = 0; j < excludeList.length; j++) {
@@ -258,11 +258,11 @@
}
}
if (!skipIt) {
List<String> l = m.get(keys[i]);
if (l == null) {
- l = new ArrayList<String>();
+ l = new ArrayList<>();
m.put(keys[i], l);
}
l.add(values[i]);
} else {
// reset the flag
@@ -272,11 +272,11 @@
if (include != null) {
for (Map.Entry<String,List<String>> entry: include.entrySet()) {
List<String> l = m.get(entry.getKey());
if (l == null) {
- l = new ArrayList<String>();
+ l = new ArrayList<>();
m.put(entry.getKey(), l);
}
l.addAll(entry.getValue());
}
}
< prev index next >