You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2024/07/01 23:41:00 UTC

[jira] [Commented] (CONFIGURATION-848) SubsetConfiguration does not account for delimiters as it did in 2.9.0

    [ https://issues.apache.org/jira/browse/CONFIGURATION-848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17861286#comment-17861286 ] 

Gary D. Gregory commented on CONFIGURATION-848:
-----------------------------------------------

Hello [~laszlohujber]

The test {{org.apache.commons.configuration2.TestSubsetConfiguration848.testSubsetWithJSONConfiguration()}} is fixed in git master and snapshot builds in https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-configuration2/2.11.1-SNAPSHOT/

Please test your use case.

The test {{org.apache.commons.configuration2.TestSubsetConfiguration848.testSubsetConfigurationWithIndexAndDelimiter()}} does not work in 2.9.0 for me (or in git master).

I'm not sure it is supposed to work as coded. Please clarify.


> SubsetConfiguration does not account for delimiters as it did in 2.9.0
> ----------------------------------------------------------------------
>
>                 Key: CONFIGURATION-848
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-848
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 2.10.0, 2.10.1, 2.11.0
>            Reporter: Laszlo Hujber
>            Assignee: Gary D. Gregory
>            Priority: Major
>
> A bug occurs when using {{SubsetConfiguration}} with concrete subclasses of {{{}AbstractHierarchicalConfiguration{}}}. This issue likely happens because {{AbstractHierarchicalConfiguration}} does not override:
> {code:java}
> protected Iterator<String> getKeysInternal(String prefix, String delimiter) {
> }
> {code}
> The relevant pull request that introduced this bug is [#300|https://github.com/apache/commons-configuration/pull/300].
> Refer to the test case that passes in version 2.9.
> {code:java}
>     @Test
>     public void testSubsetWithJSONConfiguration() throws FileNotFoundException, ConfigurationException {
>         final JSONConfiguration jsonConfiguration = new JSONConfiguration();
>         jsonConfiguration.read(new FileReader(ConfigurationAssert.getTestFile("test.json").getAbsolutePath()));
>         final SubsetConfiguration subset = new SubsetConfiguration(jsonConfiguration, "capitals(0)", ".");
>         assertFalse(subset.isEmpty());
>         assertEquals(2, subset.size());
>         assertEquals("USA", subset.getString("country"));
>     }
> {code}
> Actual Behavior:
>  * {{isEmpty()}} returns {{{}true{}}}.
>  * {{size()}} returns {{{}0{}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)