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

[configuration] PropertiesConfiguration doesn't handle trailing backslashes properly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      35119

      Description

      When a .properties file is parsed, we only look at the last character to check
      if the value is spread over several lines, but this is not sufficient. As
      specified by the javadoc for java.util.Properties:

      "Note that it is not sufficient to only examine the character preceding a line
      terminator sequence to see if the line terminator is escaped; there must be an
      odd number of contiguous backslashes for the line terminator to be escaped.
      Since the input is processed from left to right, a non-zero even number of 2n
      contiguous backslashes before a line terminator (or elsewhere) encodes n
      backslashes after escape processing."

      Currently this file:

      key1=abc
      key2=xyz

      is parsed as a file containing a single property:

      key1 -> abc\key2=xyz

      It should be parsed as a configuration containing two properties:

      key1 -> abc\
      key2 -> xyz

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: