mergePropertiesIntoMap copies non-String values as well (SPR-5669)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -99,7 +99,12 @@ public abstract class CollectionUtils {
|
||||
if (props != null) {
|
||||
for (Enumeration en = props.propertyNames(); en.hasMoreElements();) {
|
||||
String key = (String) en.nextElement();
|
||||
map.put(key, props.getProperty(key));
|
||||
Object value = props.getProperty(key);
|
||||
if (value == null) {
|
||||
// Potentially a non-String value...
|
||||
value = props.get(key);
|
||||
}
|
||||
map.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user