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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: