Robert Munteanu created FELIX-6273:
--------------------------------------

             Summary: Improve behaviour when delimiter is set but type is not 
an array
                 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


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)

Reply via email to