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

[configuration] ConfigurationUtils.copy() does not work for XMLConfigurations with repeated keys

    Details

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

      Operating System: All
      Platform: All

    • Bugzilla Id:
      35772

      Description

      Copying an XMLConfiguration using the ConfigurationUtils.copy() method does
      not work if there are repeated keys. The end result is an XMLConfiguration
      with a majority of its properties missing because only the first property
      value for a repeated key is copied to the configuration.

      This can be repeated by taking the example database tables XML file on the
      Jakarta Commons Configuration webpage, loading the configuration into an XML
      configuration, creating a new XMLConfiguration using the empty constructor,
      copying the first to the second using the ConfigurationUtils.copy() method,
      and then perform the property queries as described on the webpage. For
      example, calling getProperty() for 'tables.table(2).name' will fail on the new
      configuration after the original configuration is copied.

      This copying is the basis of my entire implementation because I want to be
      able to copy an XMLConfiguration without having to go to the operating system
      and reload a copy from disc.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jamock@mindspring.com Jeffrey Mock
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: