You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Oded Noam <od...@adamind.com> on 2006/04/02 19:21:14 UTC

[configuration] Preserving comments when saving properties file

Hey all,

I have just submitted a bug and an attached patch that modifies
PropertiesConfiguration to preserve the line comments of a properties
file when saving it. This allows for applications to change
configuration and save it, without making the file incomprehensible to
humans that may try to edit it in the future.

See http://issues.apache.org/bugzilla/show_bug.cgi?id=39182 for the
change.

Many applications would not consider this bug a problem, since they do
not allow user editing of the properties files or the do not change
properties from within the program. Therefore, comment preservation can
be disabled, and for backward compatibility (and reducing memory usage
by the properties mechanism), it is disabled by default.

I can think some improvements that may make this change even more
useful, such would be:
- Commenting out the property line when using "clearProperty"
- Pulling up the change in such way that it would apply to configuration
formats other than properties.

As well as other ideas that come to mind. Any comments would be most
welcome.

Oded Noam

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