felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (FELIX-2366) Avoiding property substitution by escaping does not remove escape character
Date Fri, 28 May 2010 09:31:36 GMT

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

Guillaume Nodet resolved FELIX-2366.

         Assignee: Guillaume Nodet
    Fix Version/s: fileinstall-3.1.0
       Resolution: Fixed

Committing to https://svn.apache.org/repos/asf/felix/trunk ...
	M	fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
	M	fileinstall/src/test/java/org/apache/felix/fileinstall/internal/UtilTest.java
Committed r949136

> 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.1.0
> 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 is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message