LinkedCaseInsensitiveMap overrides putAll method as well (for IBM JDK 1.6 compatibility; SPR-7969)

master
Juergen Hoeller 13 years ago
parent e7d1b5e0ee
commit b391629de1
  1. 12
      org.springframework.core/src/main/java/org/springframework/util/LinkedCaseInsensitiveMap.java

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -92,6 +92,16 @@ public class LinkedCaseInsensitiveMap<V> extends LinkedHashMap<String, V> {
return super.put(key, value);
}
@Override
public void putAll(Map<? extends String, ? extends V> map) {
if (map.isEmpty()) {
return;
}
for (Map.Entry<? extends String, ? extends V> entry : map.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
@Override
public boolean containsKey(Object key) {
return (key instanceof String && this.caseInsensitiveKeys.containsKey(convertKey((String) key)));

Loading…
Cancel
Save