Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-2148

Properties file with a properties hierarchy not read consistently correctly if a node has both a value and children

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.0.Final
    • Fix Version/s: 2.2.0.Final
    • Component/s: core
    • Labels:
      None
    • Story Points:
      5
    • Steps to Reproduce:
      Hide

      See added test methods in ConfigViewFactoryTest in pull request.

      Show
      See added test methods in ConfigViewFactoryTest in pull request.

      Description

      Given the following properties file passed on the command line to a Thorntail hollow jar with --properties file.properties:

      parent.children=child1,child2
      parent.children.child1.name=Jack
      parent.children.child2.name=Jill
      

      Expected:
      There are three new system properties, namely parent.children, parent.children.child1.name and parent.children.child2.name.

      Actual:
      Results are undefined and depend on the order in which the properties actually end up being submitted to the ConfigResolutionStrategy instance. If the are submitted in the order above, the result is as expected. However, if they are submitted in reverse order, the value for parent.children ends up overriding the child nodes of parent.children and the end result is that only one new system property is added, namely parent.children.

      I have reproduced this in a unit test and fixed the issue. I will submit a pull request for this.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                fransflippo F F
                Reporter:
                fransflippo F F
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: