clearProperty() does not generate events
----------------------------------------
Key: CONFIGURATION-241
URL: http://issues.apache.org/jira/browse/CONFIGURATION-241
Project: Commons Configuration
Issue Type: Bug
Affects Versions: 1.3 Final
Environment: Java 1.5, Windows XP
Reporter: Mike Whittemore
I am loading configuration information from multiple sources and have
registered a listener with the resulting configuration object. Unfortunately
the listener does not receive "clear property" events. I've confirmed that it
can properly receive other events (like "set property"), and that calls to
"clearProperty()" do actually clear the property, so I believe this may be a
bug in commons-configuration. I've tried setting "details" to true, which had
no effect. Below is a watered down version of what I am doing (note, my
configuration file simply pulls in a property file containing this property:
name.first=Mike):
ConfigurationFactory configurationFactory = new ConfigurationFactory();
URL configFileURL = ... get the config file ...
configurationFactory.setConfigurationURL(configFileURL);
Configuration configuration = ConfigurationFactory.getConfiguration();
configuration.addConfigurationListener(new ConfigurationListener() {
public void configurationChanged(ConfigurationEvent e) {
System.out.println(e.getPropertyName() + ": " + e.getPropertyValue());
}
});
System.out.println(configuration.getProperty("name.first")); // prints "Mike"
configuration.claerProperty("name.first")); // no output whatsoever
System.out.println(configuration.getProperty("name.first")); // prints "null"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]