[jira] [Created] (CONFIGURATION-734) Inconsistent/strange configuration keys for attributes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (CONFIGURATION-734) Inconsistent/strange configuration keys for attributes

JIRA jira@apache.org
Hao Chen created CONFIGURATION-734:
--------------------------------------

             Summary: Inconsistent/strange configuration keys for attributes
                 Key: CONFIGURATION-734
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-734
             Project: Commons Configuration
          Issue Type: Bug
            Reporter: Hao Chen


Given the following configuration-1.xml:

<configuration>
    <node type="test" types="a,b,c"/>
</configuration>

If you get the configuration using something like:

            Parameters params = new Parameters();
            ReloadingFileBasedConfigurationBuilder<XMLConfiguration> builder = new ReloadingFileBasedConfigurationBuilder<XMLConfiguration>(XMLConfiguration.class);
            builder.configure(params.xml().setFile("configuration-1.xml ").setListDelimiterHandler(new DefaultListDelimiterHandler(',')));
            XMLConfiguration configuration = builder.getConfiguration();

Then you print the keys using configuration.getKeys(), you will get something like: node[@type], node[@types]

However, if you use a combined configuration.xml like:

<configuration>
  <override>
    <xml fileName="configuration-1.xml" reloadingRefreshDelay="10000" config-name="config3" config-optional="false" throwExceptionOnMissing="false"/>
  </override>
</configuration>

And you get the configuration using:

            Parameters params = new Parameters();
            ReloadingCombinedConfigurationBuilder builder = new ReloadingCombinedConfigurationBuilder();
            builder.configure(params.fileBased().setFile(new File("configuration.xml ")).setListDelimiterHandler(new DefaultListDelimiterHandler(',')));
            CombinedConfiguration configuration = builder.getConfiguration();

Then when you print the configuration keys, you will get something like: node/@type, node/@types - this format seems to be the standard one and keys in the above example look very strange.

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)