You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2007/04/26 00:30:15 UTC

[jira] Updated: (CONFIGURATION-6) [configuration] XMLConfiguration inconsistency towards empty values

     [ https://issues.apache.org/jira/browse/CONFIGURATION-6?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated CONFIGURATION-6:
---------------------------------------

    Fix Version/s: 1.2
      Environment:     (was: Operating System: other
Platform: All)

> [configuration] XMLConfiguration inconsistency towards empty values
> -------------------------------------------------------------------
>
>                 Key: CONFIGURATION-6
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-6
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Etienne Lacazedieu
>             Fix For: 1.2
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org