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=28660>. 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=28660 [Configuration] Lists in a CompositeConfiguration ------- Additional Comments From [EMAIL PROTECTED] 2004-05-14 16:16 ------- I have a patch that solves the problem. Add this method to CompositeConfiguration: /** * Adds a configuration. A call to * [EMAIL PROTECTED] CompositeConfiguration#addConfiguration(Configuration)} is * equalivant to calling this method with <code>append</code> set to * <code>true</code>. * * @param config the configuration to add * @param append if <code>true</code> list/array entries are added at the * end of existing lists; otherwise they are only used as a fallback, i.e. * if no list/array entry with the same key exists in previously added * configurations (for non-list/array entries the first match is used in * any case, so there is no difference) */ public void addConfiguration(final Configuration config, final boolean append) { if (!append) { // getList *does* append, so if this isn't the requested behavior // we delete any entries from the new configuration that are // already present final Iterator keys = getKeys(); String key; while (keys.hasNext()) { key = (String) keys.next(); config.clearProperty(key); } } // delegate addConfiguration(config); } This way users can either call addConfiguration(conf) resp. addConfiguration(conf, true) to get the append behavior: list elements from different configurations will be joined. Or they can call addConfiguration(conf, false) to get the list elements from the first matching configuration only. It's probably not the optimal solution but at least it fixes this bug without introducing incompatibilites. BTW, it there any changes that a 1.0 version will come out soon? Or at least a new -devX version that will be published at http://www.ibiblio.org/maven/ ? That would be very useful for Maven users (such as me)... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
