commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Janusz Studzizba (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-228) XMLConfiguration.subset() with FileChangedReloadingStrategy does *not* 'see' file changes
Date Mon, 25 Sep 2006 07:21:51 GMT
Janusz Studzizba commented on CONFIGURATION-228:


IMHO it is not a "life" subset link to parent configuration. issue.
See my code line designated with [AA]:
   Configuration parentItemConfig = config.subset("parent-item");   //[AA] 

I am creating *new* subset from parent configuration, parent config is realoded, while newly
created subset from such reloaded refreshed parent returns old values..

I looked into source code, and IMHO realod() method should be called in somewhere in subset()
as it is called in eg. AbstractFileConfiguration.getProperty()

> XMLConfiguration.subset() with FileChangedReloadingStrategy does *not* 'see' file changes
> -----------------------------------------------------------------------------------------
>                 Key: CONFIGURATION-228
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>            Reporter: Janusz Studzizba
> XMLConfiguration.subset() with FileChangedReloadingStrategy does *not* 'see' file changes
> Configuration.xml:
> <conf>
>     <parent-item>
>         <sub-item>old_value</sub-item>
>     </parent-item>
> </conf>
> 1. XMLConfiguration is loaded:
>             config = new XMLConfiguration("c:\\conf.xml");
>             config.setReloadingStrategy(new FileChangedReloadingStrategy());
> 2. Now, <sub-item> node value changes to "new_value",
> and the code:
>             Configuration parentItemConfig = config.subset("parent-item"); [AA]
>             String ss2 = parentItemConfig.getString("sub-item");
> returns "old_value" !!!
> while:  config.getString("parent-item.sub-item"); returns new refreshed value.
> It is a bug, we have FileChangedReloadingStrategy, we create new subset in [AA] but receive
old values.
> [for now, workaround for config users is to call config.reload() when strategy.hasChanged()]

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