You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2007/07/02 22:03:05 UTC
[jira] Commented: (CONFIGURATION-283) CombinedConfiguration doesn't
take escaped characters into account.
[ 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