Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-418

incorrect backslash parsing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Commons Configuration 1.6

      Description

      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

        Attachments

        1. Main.java
          0.6 kB
          Ricky Martin
        2. PropertyConverter.diff
          0.7 kB
          Ricky Martin
        3. sample.properties
          0.1 kB
          Ricky Martin

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rickyepoderi Ricky Martin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: