Fixed constructor of ConfigurationParser to do mergind of provided properties

This commit is contained in:
andrea
2015-03-14 17:31:11 +01:00
parent 34c668714a
commit 0aad3cbbf3
3 changed files with 19 additions and 9 deletions
@@ -46,13 +46,14 @@ class ConfigurationParser {
ConfigurationParser() {
createDefaults();
}
/**
* Crate a ConfigurationParser merging the default properties with the provided ones.
* */
ConfigurationParser(Properties properties) {
createDefaults();
for (Entry<Object, Object> entrySet : m_properties.entrySet()) {
if (properties.containsKey(entrySet.getKey())) {
entrySet.setValue(properties.get(entrySet.getKey()));
}
this();
for (Entry<Object, Object> entrySet : properties.entrySet()) {
m_properties.put(entrySet.getKey(), entrySet.getValue());
}
}