Issue Details (XML | Word | Printable)

Key: CONFIGURATION-338
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Oliver Heger
Reporter: David Donn
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Configuration

PropertiesConfiguration should allow variable interpolation for includes

Created: 08/Oct/08 07:33 AM   Updated: 22/Aug/09 07:36 PM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works include-interpolation.patch 2008-10-09 06:37 AM David Donn 2 kB

Resolution Date: 10/Oct/08 07:38 PM


 Description  « Hide
It would be nice if Include files were subject to the same variable interpolation as regular properties.

e.g. it should be possible to do
include=${sys:myfilename}

I think it is simply a matter of changing the call in to loadIncludeFile() PropertiesConfiguration.propertyLoaded() from:

loadIncludeFile(files[i].trim());

to:

loadIncludeFile(interpolate(files[i].trim()));

I am happy to submit a patch.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Oliver Heger added a comment - 08/Oct/08 08:05 PM
Many thanks!

A patch would be appreciated. Any chance you could also provide a unit test?


David Donn added a comment - 09/Oct/08 06:37 AM
I have attached my patch. It includes a test. Please let me know if there are any problems and I will fix as this feature it quite important for me so I am keen to get it included.

Oliver Heger added a comment - 09/Oct/08 08:31 PM
Patch applied in revision r703248. Many thanks!

(Leaving open until the patch is also applied to the configuration2 branch.)


Oliver Heger added a comment - 10/Oct/08 07:38 PM
The patch was also ported to the configuration2 branch.