You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2006/12/02 19:47:22 UTC

[jira] Resolved: (CONFIGURATION-241) clearProperty() does not generate events

     [ http://issues.apache.org/jira/browse/CONFIGURATION-241?page=all ]

Oliver Heger resolved CONFIGURATION-241.
----------------------------------------

    Fix Version/s: Nightly Builds
       Resolution: Fixed

Fixed now in subversion. Thank you for spotting this.

> 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
>             Fix For: Nightly Builds
>
>
> 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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org