felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (FELIX-2366) Avoiding property substitution by escaping does not remove escape character
Date Tue, 17 Mar 2015 07:03:40 GMT

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

Carsten Ziegeler closed FELIX-2366.
-----------------------------------

> Avoiding property substitution by escaping does not remove escape character
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-2366
>                 URL: https://issues.apache.org/jira/browse/FELIX-2366
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.0.0
>            Reporter: Bengt Rodehav
>            Assignee: Guillaume Nodet
>             Fix For: fileinstall-3.0.2
>
>
> To avoid property substitution, an escape character was introduced in version 3.0.0 of
File Install. The idea is that if I want to send the configuration value
>   ${propkey}
> to my application without property substitution to take place, I can escape the START_DELIM
(${) and STOP_DELIM (}) with a backslash as follows:
>   $\{propkey\}
> However, when doing this the escape character is not removed from the string. The reason
is as follows:
> The method of interest is substVars in class org.apache.felix.fileinstall.internal.Util.
The logic tries to find matching DELIM_START (${) and DELIM_STOP (}). When you escape either
of these (by specifying a backslash before "${" and/or "}"), the logic will never find matching
DELIM_START and DELIM_STOP which causes the method to immediately return without performing
property substitution. The logic at the end of the method (that removes the backslashes) is
never reached.
> A workarount is to add an unnecessary property at the end of the value just to make sure
some property substitution will take place since then the logic at the end of the substVars()
method (that removes the escape character) will be reached. Thus, this works:
>   $\{propkey\}${#}



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

Mime
View raw message