commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] [Resolved] (CONFIGURATION-640) Colon in properties file value no longer unescaped in commons configuration 2
Date Fri, 07 Oct 2016 20:09:20 GMT


Oliver Heger resolved CONFIGURATION-640.
       Resolution: Fixed
    Fix Version/s: 2.2

A fix has been applied in revision 1763821.

In Configuration 1.x, unescaping was done for all characters except for the list delimiter
character. This was changed for Configuration 2.x because here the list delimiter character
is not known to the configuration, but is managed by the ListDelimiterHandler. As a side-effect,
the unescaping got lost.

The fix now adds a special handling for a number of characters that are listed in the Javadocs
of the method to be always escaped:

> Colon in properties file value no longer unescaped in commons configuration 2
> -----------------------------------------------------------------------------
>                 Key: CONFIGURATION-640
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Tom Byttebier
>            Priority: Minor
>             Fix For: 2.2
> 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,
> Snipped of the code I used for reading the property
> {code}
> final ConfigurationBuilder<PropertiesConfiguration> builder =                 
          new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class).configure(new
> final PropertiesConfiguration propertiesConfiguration = builder.getConfiguration();
> Assert.assertEquals("C:\\test", propertiesConfiguration.getString("test2"));
> {code}
> I've read this [section|]
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

View raw message