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

Stefan Seifert commented on FELIX-6455:
---------------------------------------

currently, there is no concept for escaping values/string in the interpolation 
syntax. FELIX-6164 introduced a special escaping support only for the first $ 
character, but not for the full string. imho we cannot simply fix the test case 
above, we need to support escaping for the whole string e.g. with \ and then 
make sure characters like \[, \], \\ etc. result in their unescaped 
correspondence and have no special meaning.

looking at the already complex parser code in 
[Interpolator.java|https://github.com/apache/felix-dev/blob/master/configadmin-plugins/interpolation/src/main/java/org/apache/felix/configadmin/plugin/interpolation/Interpolator.java],
 i'm wondering if it makes sense to make it even more complex to add escaping 
support - or if we should switch to a parser generator like javacc?

[~cziegeler] WDYT?

> configadmin.plugin.interpolation: default Value with "]" is interpreted wrong
> -----------------------------------------------------------------------------
>
>                 Key: FELIX-6455
>                 URL: https://issues.apache.org/jira/browse/FELIX-6455
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>            Reporter: Quan
>            Priority: Major
>
> configadmin.plugin.interpolation interpreted the default value with "]" wrong:
>  * $[env:notset;default=[8080]]        => [8080](/)
>  * $[env:notset;default=[aabb]cc]     => [aabbcc] (x)
> To show the bug I have created a branch with a unit test: 
> [https://github.com/apache/felix-dev/compare/master...orangeven:bugfix/configadmin-plugins-interpolation-default-value-with-special-chars?expand=1]
> Line 162 failed with message:
> {noformat}
> org.junit.ComparisonFailure: 
> Expected :[aabb]cc
> Actual :[aabbcc]{noformat}



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

Reply via email to