[
https://issues.apache.org/jira/browse/CONFIGURATION-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13241401#comment-13241401
]
Oliver Heger commented on CONFIGURATION-492:
--------------------------------------------
In the current implementation list splitting is not done on substituted
variable values. This is true for all methods supporting variables, including
{{getStringArray()}}, {{getList()}} or the get methods for simple data types.
I am not sure whether we should change this. It would probably make the
implementation more complex. In addition, it may cause constellations which are
hard to diagnose. For instance, if {{getString()}} is called on a property with
a variable which contains multiple items, should then only the first item be
returned?
Well, the documentation does not explicitly mention that the list delimiter in
variable values is not taken into account. So at least this could be improved.
> XMLConfiguration.getStringArray does not parse OS Environment Variables
> -----------------------------------------------------------------------
>
> Key: CONFIGURATION-492
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-492
> Project: Commons Configuration
> Issue Type: Bug
> Components: Interpolation
> Affects Versions: 1.8
> Environment: Windows XP, Commons Configuration 1.8
> Reporter: Chris Jackson
> Priority: Minor
>
> When using a OS environment variable in an XMLConfiguration file, the
> getStringArray() method does not correctly parse multiple items in the same
> entry.
> XML:
> ...
> <items>{$env:items}</items>
> ...
> Windows Environment variable %items% is set to "item1,item2".
> Code:
> ...
> String[] items = config.getStringArray("items")
> for (Sting item : items) {
> System.out.println("Item: " + item);
> }
> ...
> Output:
> Item: item1,item2
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira