commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Whittemore (JIRA)" <>
Subject [jira] Created: (CONFIGURATION-241) clearProperty() does not generate events
Date Sat, 02 Dec 2006 00:04:21 GMT
clearProperty() does not generate events

                 Key: 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 ...
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:
For more information on JIRA, see:


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

View raw message