mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix defaulting logic on NBConfiguration
This commit is contained in:
parent
3a54725d66
commit
ae7107916b
@ -102,7 +102,11 @@ public class NBConfiguration {
|
|||||||
|
|
||||||
Object o = data.get(name);
|
Object o = data.get(name);
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
throw new NBConfigError("config param '" + name + "' was not defined.");
|
if (param.getDefaultValue()==null) {
|
||||||
|
throw new NBConfigError("config param '" + name + "' was not defined.");
|
||||||
|
} else {
|
||||||
|
o= param.getDefaultValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ConfigModel.convertValueTo(this.getClass().getSimpleName(), name,o,type);
|
return ConfigModel.convertValueTo(this.getClass().getSimpleName(), name,o,type);
|
||||||
// if (type.isAssignableFrom(o.getClass())) {
|
// if (type.isAssignableFrom(o.getClass())) {
|
||||||
|
@ -293,7 +293,8 @@ public class ParsedTemplateMap implements LongFunction<Map<String, ?>>, StaticFi
|
|||||||
public <T> T takeStaticValue(String field, Class<T> classOfT) {
|
public <T> T takeStaticValue(String field, Class<T> classOfT) {
|
||||||
if (statics.containsKey(field)) {
|
if (statics.containsKey(field)) {
|
||||||
protomap.remove(field);
|
protomap.remove(field);
|
||||||
return (T) statics.remove(field);
|
T value = (T) statics.remove(field);
|
||||||
|
return value;
|
||||||
} else if (isConfig(field)) {
|
} else if (isConfig(field)) {
|
||||||
return getConfig(field);
|
return getConfig(field);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user