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/07/21 21:43:04 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14635695#comment-14635695 ] 

Oliver Heger commented on CONFIGURATION-605:
--------------------------------------------

Thanks for the report. I will have a look (in a couple of days).

To make sure: The key is not really gone, i.e. it can be accessed via getProperty()? It is just dropped by the toString() method?

One other remark: In the upcoming version 2.0 of Commons Configuration the list delimiter parsing has been reworked. So it may well be possible that this version behaves differently.

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