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:
Jonathan Bernard 2011-12-05 22:18:26 -06:00
parent 1227d53a14
commit 2308280480
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#Mon, 05 Dec 2011 22:11:12 -0600 #Mon, 05 Dec 2011 22:17:22 -0600
name=jdb-util name=jdb-util
version=1.4 version=1.4
lib.local=true lib.local=true
build.number=8 build.number=9

View File

@ -45,11 +45,11 @@ public class SmartConfig {
def val = props[name] def val = props[name]
if (val == null && defVal != null) { if (val == null) {
log.trace("Doesn't exists, setting with given default") log.trace("Doesn't exists, setting with given default")
val = defVal val = defVal
this.setProperty(name, defVal) if (defVal != null) { this.setProperty(name, defVal) }
} else { } else {