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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5
    • 1.6
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: