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] Commented: (CONFIGURATION-283) CombinedConfiguration doesn't take escaped characters into account.
Date Mon, 02 Jul 2007 20:03:05 GMT

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

Oliver Heger commented on CONFIGURATION-283:
--------------------------------------------

Thank you for spotting this.

I had a look at the code, and it seems that this bug is related to CONFIGURATION-272: Under
the hood ConfigurationUtils.copy() is called, which does not handle list delimiters correctly.

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