[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-5835) JBoss Tools Properties editor always removes leading backslash (\)

Viacheslav Kabanovich (JIRA) jira-events at lists.jboss.org
Fri Feb 19 05:06:10 EST 2010


    [ https://jira.jboss.org/jira/browse/JBIDE-5835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12515358#action_12515358 ] 

Viacheslav Kabanovich commented on JBIDE-5835:
----------------------------------------------

We use java.util.Properties to load a property value from the source and to save the (modified) value back to source.
Symbol '\' in source is never a part of property value but the escape symbol. When it concludes a source line, it just means that current property's value is continued on the next line. In combination '\n' it is interpreted as breaking property's value into two lines and so on. The combination \$ is interpreted as $, and entries with source values \${user.dir}, ${user.dir} are resolved into properties with equal value ${user.dir}.

I assume that most technologies treat *.properties files by loading them into java.util.Properties and that is why we do the same in our visual editor. However, some tools (Maven?, no Seam?) may in runtime preprocess content of *.properties files treating them as text and for such a preprocessing tool \${user.dir} and ${user.dir} may be considered differently according to rules of that specific tool. If a tool loads Java properties object before treating ${} sequences, it will find ${\u0075\u0073\u0065\u0072\u0051\u002e\u0064\u0069\u0072} equivalent to ${user.dir}, but if it makes replacements before creating Java properties object, then of course they are not identical. We cannot suit all tools, our visual editor is compatible to those that follow the first pattern.

Now, about saving a value modified in the visual editor. For many characters (e.g.English letters, digits) there are two ways to put them into source (e.g. \u0075 == u), for $ there are three ways (\$ == \u0024 == $). We delegate saving to source to the implementation of java.util.Properties class, and it decides about source representation for each character. In the past, we already had code versions that copied some internal methods of java.util.Properties, with modifications to enforce some of our logic, and I believe that was not good, and it was a step forward when we dropped that code, but we would have to go back to that approach if we are going to change logic of saving on the base of merging new value with source representation of the old value.


> JBoss Tools Properties editor always removes leading backslash (\)
> ------------------------------------------------------------------
>
>                 Key: JBIDE-5835
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-5835
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>    Affects Versions: 3.0.3.GA
>            Reporter: Tihomir Surdilovic
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.1.1
>
>
> Using the JBoss Tools Properties Editor for entries which have a leading backslash this backslash gets removed by JTP. The editor should not remove these leading backslashes. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list