You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2013/04/04 12:03:19 UTC

[jira] [Comment Edited] (FELIX-3542) Escape property values used as Metatype default values

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

Felix Meschberger edited comment on FELIX-3542 at 4/4/13 10:01 AM:
-------------------------------------------------------------------

Hmm, ok, I see.

Ok, I think the SCR plugin should probably properly handle escaping: if a property value contains special characters requiring escaping in the Metatype Service, the SCR plugin should escape them when writing the metatype.xml file.

That is the value of 

> @Property(value="sample\\ value")

should be written as "sample\ value" to the DS descriptor and "sample\\ value" to the Metatype descriptor.
                
      was (Author: fmeschbe):
    Hmm, ok, I see.

Ok, I think the SCR plugin should probably properly handle escaping: if a property value contains special characters requiring escaping in the Metatype Service, the SCR plugin should escape them when writing the metatype.xml file.
                  
> Escape property values used as Metatype default values
> ------------------------------------------------------
>
>                 Key: FELIX-3542
>                 URL: https://issues.apache.org/jira/browse/FELIX-3542
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>            Reporter: Ankur Pathela
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> For a component property defined as below:
> ~~~~~~~~~~~~
> static private final String DEFAULT_FILE_PATTERN = "(?i)index\\.html";
> @Property(value=DEFAULT_FILE_PATTERN)
> static private final String PN_FILE_PATTERN = "file.pattern"; 
> ~~~~~~~~~~~~
> The backslash gets eaten up in the felix web console. The default value should appear as (?i)index\.html but ends up looking like (?i)index.html. This regex has a different meaning than the one intended.
> The component gets the correct initial value. But things fail when you open the property editor and save without making any changes(because the editor loaded up with an incorrect default value). Note that the property values when saved from the property editor render correctly the next time the editor loads.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira