Bugfix.
Default behavior in SmartConfig was wrong. What it should be (and now is) is when a value is requested but not present, the value is set and returned with the default if given, or null is returned if no default is given.
This commit is contained in:
@ -45,11 +45,11 @@ public class SmartConfig {
|
||||
|
||||
def val = props[name]
|
||||
|
||||
if (val == null && defVal != null) {
|
||||
if (val == null) {
|
||||
log.trace("Doesn't exists, setting with given default")
|
||||
|
||||
val = defVal
|
||||
this.setProperty(name, defVal)
|
||||
if (defVal != null) { this.setProperty(name, defVal) }
|
||||
|
||||
} else {
|
||||
|
||||
|
Reference in New Issue
Block a user