Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1
-
None
-
None
-
35963
Description
Empty values are not read correctly from XML files : when a XML file contains an
empty element, the corresponding keys are not present in the configuration, but
an empty string can be saved!
Consider the following code :
XMLConfiguration config = new XMLConfiguration();
config.setProperty("foo.bar", "");
config.save("config.xml");
System.out.println("Config saved!");
System.out.println("foo.bar in config1 = "+config.getProperty("foo.bar"));
XMLConfiguration config2 = new XMLConfiguration("config.xml");
System.out.println("foo.bar in config2= "+config2.getProperty("foo.bar"));
The output is :
foo.bar in config1 = ''
foo.bar in config2 = 'null'
the file config.xml contains :
<configuration>
<foo>
<bar/>
</foo>
</configuration>
this also does not allow to distinguish between an empty value and a missing key.
Attachments
Issue Links
- is related to
-
CONFIGURATION-403 XMLConfiguration isEmpty has altered behaviour between 1.4 and 1.6
- Closed