Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1012

Documentation states that :- behaves like bash; it doesn't, but it should

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • 1.3.12, 1.5.12
    • 1.1.2
    • logback-core
    • Scala/java/OSX/Linux

    Description

      The :- operator in bash expands the right-hand-side when the left-hand-side is undefined or empty. logback only expands the RHS when the LHS is undefined. Thus, a system property that has been defined but not assigned (e.g., -Ddefined) does not trigger default expansion, because such parameters actually have the empty string as their value.

      Chapter 3 of the documentation states that this operator is based on the operator with the same name in Bash. Bash, however, expands on blank:

      X=""
      echo ${X:-3}

      will echo 3.

      I would prefer that logback adopt the same semantics as Bash; but if this is not possible due to backward-compatibility reasons, the documentation should be updated to point out that this differs from Bash for this corner case.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            jeffrey_aguilera Jeffrey Aguilera
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: