You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2007/05/21 22:32:16 UTC

[jira] Created: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
----------------------------------------------------------------------------------------------------------

                 Key: CONFIGURATION-269
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Oliver Heger
         Assigned To: Oliver Heger
             Fix For: 1.5


PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.

This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg resolved CONFIGURATION-269.
------------------------------------------

    Resolution: Fixed

Thank you for the test Oliver, I integrated it. I added a ConfigurationAssert class to check if two configurations are similar, that may be useful elsewhere.

> PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-269
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Emmanuel Bourg
>             Fix For: 1.5
>
>         Attachments: Config-269_test.diff, properties.patch
>
>
> PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.
> This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497838 ] 

Oliver Heger commented on CONFIGURATION-269:
--------------------------------------------

Splitting is disabled, so the properties should not be splitted. The delimiter parsing disabled flag needs to be checked and, if it is set, the escaping of the list delimiter must be avoided.

> PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-269
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Oliver Heger
>             Fix For: 1.5
>
>
> PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.
> This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated CONFIGURATION-269:
-----------------------------------------

    Attachment: properties.patch

Here is the patch I have in mind :

- If the list delimiter is disabled, forcing single lines has no effect, and the list properties are written on several lines. It doesn't make sense to disable the delimiter and expect list properties to be saved on a single line. If the user really wants single line properties to remain compatible with the standard Properties format, he has to enable the delimiter and change it to something else, like the pipe character.

- PropertiesWriter doesn't escape the delimiter if the delimiter is null. This is a simple change that avoid adding a state to PropertiesWriter (delimiter enabled/disabled) or a reference to the parent configuration.


> PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-269
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Oliver Heger
>             Fix For: 1.5
>
>         Attachments: properties.patch
>
>
> PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.
> This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497582 ] 

Emmanuel Bourg commented on CONFIGURATION-269:
----------------------------------------------

The best solution is to split the property on several lines.

I can work on this Oliver if you haven't started yet.

> PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-269
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Oliver Heger
>             Fix For: 1.5
>
>
> PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.
> This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger updated CONFIGURATION-269:
---------------------------------------

    Attachment: Config-269_test.diff

The patch looks good. Here is a unit test demonstrating the problem. If you like, go on and apply it.

> PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-269
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Oliver Heger
>             Fix For: 1.5
>
>         Attachments: Config-269_test.diff, properties.patch
>
>
> PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character.
> This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org