You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (Jira)" <ji...@apache.org> on 2021/09/06 06:40:00 UTC

[jira] [Resolved] (FELIX-6273) Improve behaviour when delimiter is set but the type is not

     [ https://issues.apache.org/jira/browse/FELIX-6273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved FELIX-6273.
-------------------------------------
    Resolution: Fixed

Improved in [1] by automatically assuming type is String[] if a delimiter is specified

[1] https://github.com/apache/felix-dev/commit/b236c6b45af211e43eda05289467505efcd904ce

> Improve behaviour when delimiter is set but the type is not
> -----------------------------------------------------------
>
>                 Key: FELIX-6273
>                 URL: https://issues.apache.org/jira/browse/FELIX-6273
>             Project: Felix
>          Issue Type: Improvement
>          Components: Configuration Admin
>    Affects Versions: configadmin-interpolation-plugin-1.1.0
>            Reporter: Robert Munteanu
>            Assignee: Carsten Ziegeler
>            Priority: Major
>             Fix For: configadmin-interpolation-plugin-1.2.2
>
>
> When configuring property values with a delimiter, it is expected that the property is an array. Otherwise, the delimited does not make sense IMO.
> Assuming I have exporter {{PROP=foo,bar}}.
> If I configure interpolation for a property value as
> prop="$[env:PROP;delimiter=,]"
> At runtime it get interpolated to {{prop<String> = foo,bar}}, which is clearly not what I expected. The correct syntax is
> prop="$[env:PROP;type=String[];delimiter=,]"
> after which the interpolation result is indeed {{ prop<String[]> = [foo, bar] }}.
> There are a number of ways this could be improved
> - fail interpolation with an exception
> - log a WARN/ERROR message
> - assume that if a delimiter is present but the type is not, the type is {{String[]}}, and not {{String}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)