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

[configuration] SubsetConfiguration.getKeys() always appends "." delimiter to prefix

    XMLWordPrintableJSON

Details

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

    • 33691

    Description

      When creating a SubsetConfiguration object, e.g.

      conf = new SubsetConfiguration(parentConf, "myprefixwithadot.");

      calls to conf.getProperty("prop") result in a call to
      parent.conf(conf.getPrefix() + "prop") as expected.

      However, a key iterator obtained by calling conf.getKeys() will only iterate
      over keys starting with (conf.getPrefix() + "."). In the example, this will be
      "myprefixwithadot..". There should not be a dot appended.

      The error is probably caused by line #283 in AbstractConfiguration.java

      return key.startsWith(prefix + ".") || key.equals(prefix);

      Attachments

        Activity

          People

            Unassigned Unassigned
            timothomas@web.de Timo Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: