Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2
-
None
-
None
Description
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()]