[
https://issues.apache.org/jira/browse/CONFIGURATION-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved CONFIGURATION-769.
-------------------------------------------
Fix Version/s: 2.8
Resolution: Fixed
This fix requires you to disable caching, you will need to update code (from
the test), from, for example:
{code}
final FileBasedConfigurationBuilder<PropertiesConfiguration> builder =
new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class)
.configure(new FileBasedBuilderParametersImpl()
.setURL(url));
{code}
to:
{code}
final FileBasedConfigurationBuilder<PropertiesConfiguration> builder =
new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class)
.configure(new FileBasedBuilderParametersImpl()
.setURL(url, new URLConnectionOptions().setUseCaches(false)));
{code}
Note the use of
{{setURL(URL, URLConnectionOptions)}}
instead of
{{setURL(URL)}}
> commons configuration addProperty method replaces < > with < >
> ------------------------------------------------------------------
>
> Key: CONFIGURATION-769
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-769
> Project: Commons Configuration
> Issue Type: Bug
> Components: Format
> Affects Versions: 2.6
> Reporter: Deepraj jha
> Priority: Critical
> Fix For: 2.8
>
>
> I am using latest Apache commons configuration 2 version 2.6 and when trying
> to invoke addProperty it replaces < > with < >.
> example :
> cfg.addProperty("data.array(0).var(0)", "<var name=myds1>" );
> cfg.write(new FileWriter(this.XmlFile));
> Here cfg is XMLConfiguration Object
> The resulting xml is :
> {{ <var><var name=myds1></var>}}
> Expected is :
> {{ "<var name=myds1>"}}
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)