Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-171

[configuration][patch] Enhancement: multiple interpolation

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      As posted by Jeff Barrett [JBarrett@sawyermedia.com]
      Here's my original message w/ a more informative subject line and patches split
      up into different files, zipped up.

      =======================================================
      I don't have much experience sending patches, so please let me know if I could
      have sent this in a better way.

      This patch does two things:
      1) fixes configuration so it builds w/ maven
      2) adds support for multiple levels of interpolation

      1)a) maven.xml had a bad variable reference that caused test.properties to be
      copied to the wrong place which caused TestClassPropertiesConfiguration to fail
      1)b) project.xml had a bad unit test excludes that didn't exclude an abstract
      TestCase class

      2)a) BaseConfiguration.java now supports multiple levels of interpolation. for
      example:
      base.prop = /base
      first.prop = $

      {base.prop}/first
      second.prop = ${first.prop}/second

      second.prop now interpolates "/base/first/second" whereas before it
      interpolated to "${base.prop}

      /first/second".

      Checks are also in place to catch the case of looping references, e.g.
      prop.a=$

      {prop.b}

      prop.b=$

      {prop.a}

      2)b) TestBaseConfiguration.java has tests to check for proper behavior
      2)c) BasePropertiesConfiguration.java now has class javadocs that note support
      for interpolation

      +jeff

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Yoav Shapira
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development