Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-9

[configuration] PropertiesConfiguration doesn't handle trailing backslashes properly

    Details

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

      Operating System: All
      Platform: All

      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

        Activity

        Emmanuel Bourg created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35119 12342270
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Configuration [ 12310467 ]
        Key COM-2118 CONFIGURATION-9
        Component/s Configuration [ 12311107 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311710 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development