commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CONFIGURATION-283) CombinedConfiguration doesn't take escaped characters into account.
Date Thu, 12 Jul 2007 20:03:04 GMT

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

Oliver Heger resolved CONFIGURATION-283.
----------------------------------------

    Resolution: Fixed

A fix was applied to ConfigurationUtils.convertToHierarchical(), which was the source of the
problem.

This is a simple workaround for the problem with ConfigurationUtils.copy(). We might want
to touch this again when this problem is solved. But for the moment everything works fine.

> CombinedConfiguration doesn't take escaped characters into account.
> -------------------------------------------------------------------
>
>                 Key: CONFIGURATION-283
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-283
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Franck Valentin
>            Assignee: Oliver Heger
>             Fix For: 1.5
>
>
> Hi, 
> I've tried to used CombinedConfiguration but it seems escaped characters are not taken
into account :
> import org.apache.commons.configuration.CombinedConfiguration;
> import org.apache.commons.configuration.ConfigurationException;
> import org.apache.commons.configuration.PropertiesConfiguration;
> import junit.framework.TestCase;
> public class TestProp extends TestCase {
> 	
> 	public void testprop() throws ConfigurationException {
> 		// test.properties contains :
> 		//    without_escape=aa,bb
> 		//    with_escape=aa\,bb
> 		//    with_2escapes=aa\\,bb
> 		
> 		String prop_filename = "c:\\tmp\\test.properties";
> 		PropertiesConfiguration properties_config = new PropertiesConfiguration(prop_filename);
> 		CombinedConfiguration   combined_config   = new CombinedConfiguration();
> 		combined_config.addConfiguration(properties_config);
> 		
> 		System.out.println("Properties config");
> 		System.out.println(properties_config.getString("without_escape"));
> 		System.out.println(properties_config.getString("with_escape"));
> 		System.out.println(properties_config.getString("with_2escapes"));
> 		System.out.println("\nCombined config");
> 		System.out.println(combined_config.getString("without_escape"));
> 		System.out.println(combined_config.getString("with_escape"));
> 		System.out.println(combined_config.getString("with_2escapes"));
> 		
> 	}
> }
> Result : 
> ---------
> Properties config
> aa
> aa,bb
> aa,bb
> Combined config
> aa
> aa
> aa
> Thanks !
> Franck

-- 
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


Mime
View raw message