commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] [Commented] (CONFIGURATION-670) Inconsistency with configurationAt method.
Date Sat, 26 Aug 2017 19:37:01 GMT


Oliver Heger commented on CONFIGURATION-670:

I did some testing, but was not yet able to reproduce the problem. I created a test XML configuration
based on your example:
    <favoriteColors someAttr="test">

Then I added the following unit test:
    public void testConfigurationAt() throws ConfigurationException {
        conf = createFromFile("colors.xml");
        HierarchicalConfiguration<ImmutableNode> sub = conf.configurationAt("favoriteColors.Color(0)",
        assertEquals("Wrong result", "red", sub.getString(""));

(_createFromFile()_ is a helper method in the test class for {{XMLConfiguration}} which loads
the specified test file.) The test was green, the correct node was resolved.

Can you provide further information how the problem can be reproduced?

> Inconsistency with configurationAt method.
> ------------------------------------------
>                 Key: CONFIGURATION-670
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 2.1.1
>            Reporter: Magno Nascimento de Azevedo Cruz
> After some testing, I found some inconsistency with the use of {{configurationAt()}},
to simplify it, this version is working correctly, returning the {{HierarchicalConfiguration}}
pointing to the right property:
> {code:java}
> config.configurationAt("property.indexedProperty(0)", false);
> {code}
> While this version, instead of returning a {{HierarchicalConfiguration}} with the root
tracking node pointing to {{indexedProperty(0)}}, it returns the tracking node pointing to
the root of the whole tree of properties.
> {code:java}
> config.configurationAt("property.indexedProperty(0)", true);
> {code}
> I'm trying to implement a support to a new format called [SURF|]
created by GlobalMentor, but I didn't override this method, so I think it's coming from the
original implementation.
> More informations may be found at [].

This message was sent by Atlassian JIRA

View raw message