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

Unresolved (non-existend) environment variables should return null

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.9.0
    • None
    • Interpolation
    • None

    Description

      Currently Interpolation of environment variables (https://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeatures.html#Variable_Interpolation) return un-interpolated string if the environment variable doesn't exists at all.

      It would be very convenient and (I feel) more consistent if, in that case, 'null' would be returned.

       

      Alternatively, option to specify default if the variable doesn't exist would also work.

      I.e. something along the lines:

      ```

      ${env:JAVA_HOME:<default value>}

      ```

       

      From my experiments, even if we try to register custom interpolator it's not possible to explicitly return `null` from it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            .wojtek Wojtek
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: