commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39182] New: - Preserve file structure (line comments) when re-saving properties file
Date Sun, 02 Apr 2006 16:52:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39182>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39182

           Summary: Preserve file structure (line comments) when re-saving
                    properties file
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: oded.noam@adamind.com


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message