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


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to