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 2015/08/03 21:50:04 UTC

[jira] [Resolved] (CONFIGURATION-605) XMLConfiguration drops configuration key immediately following one whose value contains a comma

     [ https://issues.apache.org/jira/browse/CONFIGURATION-605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-605.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0

A unit test has been committed demonstrating that the problem no longer exists in version 2.0.

> XMLConfiguration drops configuration key immediately following one whose value contains a comma
> -----------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-605
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-605
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Format
>    Affects Versions: 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10
>         Environment: $ uname -a
> Linux 4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:30:32 UTC 2015 x86_64 GNU/Linux
> $ java -version
> openjdk version "1.8.0_45"
> OpenJDK Runtime Environment (build 1.8.0_45-b14)
> OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
>            Reporter: Emil Lundberg
>            Priority: Minor
>             Fix For: 2.0
>
>
> The following XML document:
> {noformat}
> StringBuilder sb = new StringBuilder("<configuration>");}}
> sb.append("<test1>a,b,c</test1>");
> sb.append("<test2>a</test2>");
> sb.append("<test3></test3>");
>  sb.append("<test4>a,b\\,b,c</test4>");
> sb.append("</configuration>");
> {noformat}
> when passed into {{XMLConfiguration#load(Reader)}} and then to {{ConfigurationUtils#toString(Configuration)}}, comes out like this:
> {noformat}
> test1=[a, b, c]
> test3=
> test4=[a, b,b, c]
> {noformat}
> I'm assuming this is a bug.
> I've found two workarounds to this:
>  1. Inserting any character between the {{test1}} and {{test2}} tags, i.e. {{<test1>a,b,c</test1> <test2>a</test2>}}
>  2. Calling {{setDelimiterParsingDisabled(true)}} on the XMLConfiguration before loading the document
> For reproduction with a minimal example and some additional test cases, see [this GitHub repo|https://github.com/emlun/commons-xmlconfiguration-ignored-key/]. I also posted this as [a question on Stack Overflow|https://stackoverflow.com/questions/31516549] before posting here.



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