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

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

Tom Byttebier created CONFIGURATION-640:
-------------------------------------------

             Summary: 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)