commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe Perrault (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CONFIGURATION-632) Composite configuration list variable interpolation return first element only
Date Wed, 25 May 2016 01:57:14 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299315#comment-15299315
] 

Philippe Perrault edited comment on CONFIGURATION-632 at 5/25/16 1:56 AM:
--------------------------------------------------------------------------

Hi Oliver,
Here is an exampe code:
{code}
CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
compositeConfiguration.addConfiguration(new PropertiesConfiguration("props.properties"));

String[] values = compositeConfiguration.getStringArray("key1");
System.out.println(values); // "a, b, c,"
values = compositeConfiguration.getStringArray("key2");
System.out.println(values); // "a"
{code}

with
{code:title=props.properties}
key1 = a,b,c
key2 = ${key1}
{code}

I am expecting the get an array "a, b, c" for key2 but I get only "a"
thanks!



was (Author: philippe.perrault@gmail.com):
Hi Oliver,
Here is an exampe code:
{code}
CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
compositeConfiguration.addConfiguration(new PropertiesConfiguration("props.properties"));

String[] values = compositeConfiguration.getStringArray("key1");
System.out.println(values); // "a, b, c,"
values = compositeConfiguration.getStringArray("key2");
System.out.println(values); // "a"
{code}

with
{code:title=props1.properties}
key1 = a,b,c
key2 = ${key1}
{code}

I am expecting the get an array "a, b, c" for key2 but I get only "a"
thanks!


> Composite configuration list variable interpolation return first element only
> -----------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-632
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-632
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Interpolation
>    Affects Versions: 1.9, 2.0
>         Environment: linux
>            Reporter: Philippe Perrault
>
> CompositeConfiguration.getStringArray, with variable interpolation returns only the first
element of the list
> e.g.
> key1=a,b,c
> key2=${key1}
> CompositeConfiguration.getStringArray(key2) = a



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message