16 Jul 22:03
[groovy-user] System.getproperty returns string 'false' instead of null.
From: Kallin Nagelberg <kallin.nagelberg@...>
Subject: [groovy-user] System.getproperty returns string 'false' instead of null.
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 20:06:54 GMT
Subject: [groovy-user] System.getproperty returns string 'false' instead of null.
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-16 20:06:54 GMT
I just discovered that calling System.getProperty(key) with a key that didn't exist is returning a String of value "false" instead of null.
This confuses my program as I do checks on the result like
if (result){
// do something
}
it actually does something, because "false" is not the same as empty string or null in groovy.
Has anyone experienced this?
This confuses my program as I do checks on the result like
if (result){
// do something
}
it actually does something, because "false" is not the same as empty string or null in groovy.
Has anyone experienced this?
RSS Feed