< prev index next >

src/java.base/share/classes/sun/net/www/MessageHeader.java

Print this page

        

*** 242,252 **** } 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>>(); 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++) { --- 242,252 ---- } public synchronized Map<String, List<String>> filterAndAddHeaders( String[] excludeList, Map<String, List<String>> include) { boolean skipIt = false; ! 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,268 **** } } if (!skipIt) { List<String> l = m.get(keys[i]); if (l == null) { ! l = new ArrayList<String>(); m.put(keys[i], l); } l.add(values[i]); } else { // reset the flag --- 258,268 ---- } } if (!skipIt) { List<String> l = m.get(keys[i]); if (l == null) { ! l = new ArrayList<>(); m.put(keys[i], l); } l.add(values[i]); } else { // reset the flag
*** 272,282 **** 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>(); m.put(entry.getKey(), l); } l.addAll(entry.getValue()); } } --- 272,282 ---- 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<>(); m.put(entry.getKey(), l); } l.addAll(entry.getValue()); } }
< prev index next >