commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ricky Martin (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (CONFIGURATION-418) incorrect backslash parsing
Date Tue, 01 Jun 2010 19:36:38 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874181#action_12874181
] 

Ricky Martin edited comment on CONFIGURATION-418 at 6/1/10 3:35 PM:
--------------------------------------------------------------------

Hi Oliver,

I checked out the trunk:

$ svn checkout http://svn.apache.org/repos/asf/commons/proper/configuration/trunk

An the error is still the same. I send you the files and my straight forward diff:

* Little sample.properties which shows the problem.
* A direct Main.java which lists the keys and values.
* The PropertyConverter.diff which shows how I corrected the problem (maybe too much straight
forward).

The result of the Main.java using sample.properties is the following:

share1=[\share1, \share1]
share2=[\\share2, \\share2]

Which clearly shows the different behavior if comma separated is used or not.

Thanks!

      was (Author: rickyepoderi):
    Hi Oliver,

I checked out the trunk:

$ svn checkout http://svn.apache.org/repos/asf/commons/proper/configuration/trunk

An the error is still the same. I send you the files and my straight forward diff:

* Little sample.properties which shows the problem.
* A direct Main.java which list the keys and values.
* The PropertyConverter.diff which show how I corrected the problem (maybe too much straight
forward).

The result of the Main.java using sample.properties is the following:

share1=[\share1, \share1]
share2=[\\share2, \\share2]

Which clearly shows the different behavior if comma separated is used or not.

Thanks!
  
> incorrect backslash parsing
> ---------------------------
>
>                 Key: CONFIGURATION-418
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-418
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Commons Configuration 1.6
>            Reporter: Ricky Martin
>            Priority: Minor
>         Attachments: PropertyConverter.diff, sample.properties, sample.properties
>
>
> I am using Commons Configuration (PropertiesConfiguration) and some of my data are windows
shares: \\share1 or \\share2. The problem is the parsing return different things depending
how the keys are defined. For example, these keys
> share=\\\\share1
> share=\\\\share2
> are different than:
> share=\\\\share1, \\\\share2
> The first one returns two backslashes ("\\share1" and "\\share2") and the second returns
just one ("\share1" and "\share2"). I think the problem is in PropertyConverter line 525,
cos the backslash is hidden twice when multivalue parsing is done:
> if (c != delimiter && c != LIST_ESC_CHAR) 
>                 {
>                     // no, also add escape character
>                     token.append(LIST_ESC_CHAR);
>                 }
> In my understanding the second condition produces this strange issue and it should be
like this:
> if (c != delimiter) 
>                 {
>                     // no, also add escape character
>                     token.append(LIST_ESC_CHAR);
>                 }
> Check that cos I can be missing something...
> TIA

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message