commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Resolved: (CONFIGURATION-104) [configuration] Preserve file structure (line comments) when re-saving properties file
Date Sat, 22 Jul 2006 17:10:15 GMT
     [ ]

Oliver Heger resolved CONFIGURATION-104.

    Resolution: Fixed

A new class PropertiesConfigurationLayout was added. Objects of this class are associated
with PropertiesConfiguration instances. They are able to preserve many structure related aspects
of a properties file.

Please have a look if this class fits your needs.

> [configuration] Preserve file structure (line comments) when re-saving properties file
> --------------------------------------------------------------------------------------
>                 Key: CONFIGURATION-104
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Oded Noam
>         Assigned To: Oliver Heger
>         Attachments: preserve-comments-patch, preserve-comments-patch-java1.3
> This bug applies when an application allows both manual editing of its 
> configuration files, and  manipulation of the configuration via software. When 
> saving the configuration file after changing, its file structure - file, 
> section and line comments - will all be lost. Next time a human tries to edit 
> the configuration file, all property documentation will be lost.
> I have created a fix for this problem, applicable to PropertiesConfiguration 
> and XMLPropertiesConfiguration. The fix allows these classes to preserve a 
> list of comment lines preceding each property line. By default, comments are 
> not preserved; in case the comment preservation is required, it should be 
> enabled prior to loading the configuration file using:
> AbstractFileConfiguration.setDefaultPreserveComments(true);
> The fix is implemented and tested, attached as a patch file to this bug.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message