commit | 50d92c0f14472caa69dc5bf566d2a64484123073 | [log] [tgz] |
---|---|---|
author | Richard S. Hall <rickhall@apache.org> | Mon May 11 16:06:26 2009 +0000 |
committer | Richard S. Hall <rickhall@apache.org> | Mon May 11 16:06:26 2009 +0000 |
tree | bd2396775c2f8c2c950adc14ed14374358899f8f | |
parent | ee5b49bb8ca2421f111df45a568ae6a627cbf696 [diff] |
Make sure all keys added by map constructor or putAll() are strings. (FELIX-1130) git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@773613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/util/StringMap.java b/framework/src/main/java/org/apache/felix/framework/util/StringMap.java index f45fab2..805909d 100644 --- a/framework/src/main/java/org/apache/felix/framework/util/StringMap.java +++ b/framework/src/main/java/org/apache/felix/framework/util/StringMap.java
@@ -45,12 +45,21 @@ this(caseSensitive); putAll(map); } - + public Object put(Object key, Object value) { return super.put(key.toString(), value); } + public void putAll(Map map) + { + for (Iterator it = map.entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Map.Entry) it.next(); + put(entry.getKey(), entry.getValue()); + } + } + public boolean isCaseSensitive() { return ((StringComparator) comparator()).isCaseSensitive();