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

AbstractHierarchicalConfiguration.getKeys(key) doesn't return the key

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: None
    • Labels:
      None

      Description

      The getKeys(String prefix) implementation of AbstractHierarchicalConfiguration doesn't return anything if the prefix used is the key of an existing property. The iterator returned should at least contain the key used as the prefix.

      Here is the test method for TestHierarchicalConfiguration, currently the first assertion fails:

      public void testGetKeysWithKeyAsPrefix()
      {
          Iterator<?> it = config.getKeys("order.key1");
          assertTrue("no key found", it.hasNext());
          assertEquals("1st key", "order.key1", it.next());
          assertFalse("more keys than expected", it.hasNext());
      }
      

        Attachments

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: