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

XMLConfiguration: node text: first \ (backslash) of \\ (double backslash) character will not be in the configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 1.6
    • None
    • None
    • None

    Description

      I have this configuration element in my XML configuration:

      <working-folder>\\test\test</working-folder>
      

      ... but when I want to print out the value, I notice the content of this node changed to:

       \test\test

      So the first "\" has disappeared

      I've created a M2 project that simulates the problem. Just hit mvn eclipse:eclipse and run the Test.java file .

      The problem is situated in: org.apache.commons.configuration.PropertyConverter.class. Check the method:

       public static List split(String s, char delimiter, boolean trim)

      => line 505.

      begin = 0
      c = "\"
      inEscape = true
      begin = 1
      c= "\"
      if (c != delimiter && c == LIST_ESC_CHAR) => only the second char will be printed

      Attachments

        1. xmldoublebackslash.rar
          1 kB
          Jochen Hebbrecht

        Activity

          People

            Unassigned Unassigned
            jochus Jochen Hebbrecht
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: