You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2016/09/29 19:35:20 UTC

[jira] [Commented] (CONFIGURATION-640) Colon in properties file value no longer unescaped in commons configuration 2

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

Oliver Heger commented on CONFIGURATION-640:
--------------------------------------------

Thanks for the report. There have been many changes in the escaping logic between version 1.x and 2.x, so it is well possible that a bug crept in or a feature got lost. I will have a look.

> Colon in properties file value no longer unescaped in commons configuration 2
> -----------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-640
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-640
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Tom Byttebier
>            Priority: Minor
>
> A properties file create with java escape a colon in for example a path like 
> C:\test as {noformat}C\:\\test{noformat}
> When reading this property value in commons configuration the colon is unescaped, C:\test
> When reading the property value in commons configuration 2 the colon is no longer unescaped, C\:\test.
> Snipped of the code I used for reading the property
> {code}
> final ConfigurationBuilder<PropertiesConfiguration> builder =                            new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class).configure(new Parameters().properties().setFile(path.toFile());
> final PropertiesConfiguration propertiesConfiguration = builder.getConfiguration();
> Assert.assertEquals("C:\\test", propertiesConfiguration.getString("test2"));
> {code}
> I've read this [section|http://commons.apache.org/proper/commons-configuration/userguide_v1.10/howto_properties.html#Special_Characters_and_Escaping] so I'm aware of the changes to escaping, but I'm not sure how the escaping of the colon fits into this and if there is a way around this.



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