You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2006/10/24 21:51:17 UTC

[jira] Commented: (CONFIGURATION-233) Incomplete interpolation in CompositeConfiguration.getList()

    [ http://issues.apache.org/jira/browse/CONFIGURATION-233?page=comments#action_12444473 ] 
            
Oliver Heger commented on CONFIGURATION-233:
--------------------------------------------

You are right, this is a bug.

Your patch looks good. I hope I find some time soon to write a unit test and to apply it.

Thanks for spotting this!

> Incomplete interpolation in CompositeConfiguration.getList()
> ------------------------------------------------------------
>
>                 Key: CONFIGURATION-233
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-233
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.3 Final
>         Environment: Any.
>            Reporter: Rainer Jung
>         Attachments: commons-configuration_1_3_patch.txt
>
>
> Interpolsation is mostly done by AbstractConfiguration. All classes that override get methods of AbstractConfiguration need to be careful not to break interpolsation.
> The class CompositeConfiguration overrides getList() to easily chain the results of getList for its subconfigurations. The calls to getList() in the subconfigurations does interpolsation but only inside the subconfiguration. The combined lists never get interpolated in the whole CompositeConfiguration. So whenever a reference in the value refers to a property in another subconfiguration, interpolation breaks.
> Since all the scalar get methods correctly interpolate between different sub configurations, I assume, that this special behavior in getList() is not intended.
> A simple test case would be using the ConfigurationFactory with a config.xml, that uses two property files x.properties:
> x.1=a
> x.2=b
> and y.properties:
> y=${x.1}, ${x.2}
> and then calling getList for the key "y".
> The attached patch fixes the problem locally in CompositeConfiguration. It's not very elegant, but tries to keep the fix local.
> The patch should work for 1.2, 1.3 and trunk, since getList() in CompositeConfiguration ist the same in these versions.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org