Affects Version/s: 1.1
Fix Version/s: 1.2
Operating System: Windows XP
When setting a PropertiesConfiguration reloading strategy to
FileChangedReloadingStrategy - the entire configuration is erased.
The problem is that when the FileChangedReloadingStrategy is set, the
configuration file is erased and then reloaded and then written out.
The file is erased in AbstractFileConfiguration.save(File) when a new
FileOutputStream is created. Then in the PropertiesConfiguration.save(Writer)
the call to getKeys() causes a reaload() to occur (which the strategy says needs
to be reloaded because it has been modified). But the saved config file is now
zeroed out by the new file stream, and it is read in as an empty config.
Here is a testcase that exposed this defect:
ConfigurationException, FileNotFoundException, IOException