You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Aniruddh Chitre (JIRA)" <ji...@apache.org> on 2010/06/08 14:18:12 UTC

[jira] Created: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

OverrideCombiner seems to ignore list nodes
-------------------------------------------

                 Key: CONFIGURATION-420
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
             Project: Commons Configuration
          Issue Type: Bug
          Components: Interpolation
    Affects Versions: 1.6
            Reporter: Aniruddh Chitre
            Priority: Minor


When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file.



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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Attachment:     (was: config-conf.xml)

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Attachment: config-conf.xml

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file.

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------


I am expecting that System.out.println(config.getString("sysprops/testkey")) should return 98759875789 from the second configuration file config.xml but it returns 3543453 from the first configuration file config-custom.xml. It might be correct behaviour for override but in my case I have specified the sysprops node as a list-node so I am expecting that even if the override file has sysprops the OverrideCombiner should return the value from the base configuration.


> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Description: 
When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.

		URL fileURL = TestConfig.class.getResource("config-conf.xml");
		
		try
		{
			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
			CombinedConfiguration config = configBuilder.getConfiguration(true);
			System.out.println(config.getString("sysprops/testkey"));
			System.out.println(config.getString("configprops/testkey1"));
		}
		catch (ConfigurationException e)
		{
			e.printStackTrace();
		}


  was:
When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file.




> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Attachment: config.xml

Attached sample XML files

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file.

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


[jira] Commented: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876771#action_12876771 ] 

Oliver Heger commented on CONFIGURATION-420:
--------------------------------------------

I am not sure whether I understand your problem. What would be the result you are expecting?



> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Resolved: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-420.
----------------------------------------

    Fix Version/s: 1.7
       Resolution: Invalid

This is not a bug. OverrideCombiner works as expected.

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>             Fix For: 1.7
>
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Attachment: config-conf.xml

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Commented: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877181#action_12877181 ] 

Oliver Heger commented on CONFIGURATION-420:
--------------------------------------------

No, OverrideCombiner always takes data from the first configuration, no matter if list nodes are involved or not. Only properties that are not contained in the first configuration are obtained from the second one. This is the classic override semantics.

Whether a property is a list node or not does not affect the selection performed by the combiner. This only influences the structure of the generated combined configuration.

If you have specific requirements (obviously some properties must not be overridden), you probably have to implement your own combiner.

Anyway, this is not a bug. OverrideCombiner works as expected.

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Commented: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877312#action_12877312 ] 

Ralph Goers commented on CONFIGURATION-420:
-------------------------------------------

I would suggest that you checkout trunk and then build the web site. The documentation on the combiners was improved to illustrate the difference between the OverrideCombiner, UnionCombiner, and a new MergeCombiner. The MergeCombiner may work the way you desire as it attempts to merge nodes rather than override them.

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Issue Comment Edited: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877312#action_12877312 ] 

Ralph Goers edited comment on CONFIGURATION-420 at 6/10/10 12:22 AM:
---------------------------------------------------------------------

I would suggest that you checkout trunk and then build the web site. The documentation on the combiners was improved to illustrate the difference between the OverrideCombiner, UnionCombiner, and a new MergeCombiner. The MergeCombiner may work the way you desire as it attempts to merge nodes rather than override them.

Also, after viewing that documentation, if you would like a combiner that works differently please open Jira issue that describes the way it should behave in detail. If you could provide a combiner that implements that, so much the better.

      was (Author: ralph.goers@dslextreme.com):
    I would suggest that you checkout trunk and then build the web site. The documentation on the combiners was improved to illustrate the difference between the OverrideCombiner, UnionCombiner, and a new MergeCombiner. The MergeCombiner may work the way you desire as it attempts to merge nodes rather than override them.
  
> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file. See the attached files for an example of what I mean. The following code always returns the values from config-custom even if list-nodes mentions that the sysprops node is a list-node.
> 		URL fileURL = TestConfig.class.getResource("config-conf.xml");
> 		
> 		try
> 		{
> 			DefaultConfigurationBuilder configBuilder = new DefaultConfigurationBuilder(fileURL);
> 			CombinedConfiguration config = configBuilder.getConfiguration(true);
> 			System.out.println(config.getString("sysprops/testkey"));
> 			System.out.println(config.getString("configprops/testkey1"));
> 		}
> 		catch (ConfigurationException e)
> 		{
> 			e.printStackTrace();
> 		}

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


[jira] Updated: (CONFIGURATION-420) OverrideCombiner seems to ignore list nodes

Posted by "Aniruddh Chitre (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniruddh Chitre updated CONFIGURATION-420:
------------------------------------------

    Attachment: config-custom.xml

> OverrideCombiner seems to ignore list nodes
> -------------------------------------------
>
>                 Key: CONFIGURATION-420
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-420
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.6
>            Reporter: Aniruddh Chitre
>            Priority: Minor
>         Attachments: config-conf.xml, config-custom.xml, config.xml
>
>
> When using OverrideCombiner it seems to ignore any list nodes and always return properties/values for list node from the overridden file.

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