commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Lindgren (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CONFIGURATION-599) CombinedConfiguration fails to merge correctly when one configuration only contains one property
Date Mon, 04 May 2015 07:02:06 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14526330#comment-14526330
] 

Martin Lindgren edited comment on CONFIGURATION-599 at 5/4/15 7:02 AM:
-----------------------------------------------------------------------

Yes it could berelated to my problem.

We have multiple projects which depends on an internal framework which sets up common parts
of project settings such as the configurations. This internal framework use the {{MergeCombiner}}.
I have solved the problem by adding functionality to the framework to specify which combiner
a specific project should have.

So if the {{MergeCombiner}} works as expected with the provided example this issue can be
rejected. 

Thanks.


was (Author: langen):
Yes it could related to my problem.

We have multiple projects which depends on an internal framework which sets up common parts
of project settings such as the configurations. This internal framework use the {{MergeCombiner}}.
I have solved the problem by adding functionality to the framework to specify which combiner
a specific project should have.

So if the {{MergeCombiner}} works as expected with the provided example this issue can be
rejected. 

Thanks.

> CombinedConfiguration fails to merge correctly when one configuration only contains one
property
> ------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-599
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-599
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.9
>            Reporter: Martin Lindgren
>            Priority: Critical
>
> When using a CombinedConfiguration it fails to merge properties located in both of the
configurations if one of the configuration only contains 1 property.
> {code:title=CombinedConfiguration.java|borderStyle=solid}
> 	public static void main(String[] args)
> 	{
> 		NodeCombiner combiner = new MergeCombiner();
> 		combiner.addListNode("module");
> 		CombinedConfiguration configuration = new CombinedConfiguration(combiner);
> 		
> 		XMLConfiguration xmlConf = new XMLConfiguration();
> 		xmlConf.addProperty("modules.module", "1");
> 		xmlConf.addProperty("modules.module", "2");
> 		xmlConf.addProperty("modules.module", "3");
> 		
> 		XMLConfiguration xmlConf2 = new XMLConfiguration();
> 		xmlConf2.addProperty("modules.module", "4");
> 		configuration.addConfiguration(xmlConf);
> 		configuration.addConfiguration(xmlConf2);
> 		
> 		//THIS WILL NOT PRINT THE VALUE 4 FROM XMLCONF2
> 		for(String s : configuration.getStringArray("modules.module"))
> 		{
> 			System.out.println(s);
> 		}
> 		
> 		System.out.println();
> 		//Now add one more additional property
> 		xmlConf2.addProperty("modules.module", "5");
> 		
> 		//NOW IT WILL PRINT BOTH VALUE 4 AND 5 FROM XMLCONF2
> 		for(String s : configuration.getStringArray("modules.module"))
> 		{
> 			System.out.println(s);
> 		}
> 	}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message