Commons Configuration
  1. Commons Configuration
  2. CONFIGURATION-29

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

    Details

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

      Operating System: All
      Platform: All

      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);

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Timo Thomas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development