Issue Details (XML | Word | Printable)

Key: CONFIGURATION-332
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Oliver Heger
Reporter: Emmanuel Bourg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Configuration

PropertiesConfiguration.save() doesn't persist properties added through a DataConfiguration

Created: 04/Jul/08 03:54 PM   Updated: 22/Aug/09 07:36 PM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Not Specified

Resolution Date: 01/Aug/08 07:48 PM


 Description  « Hide
There is a regression in Commons Configuration with PropertiesConfiguration wrapped into a DataConfiguration. The properties added through a DataConfiguration aren't persisted when the configuration is saved, but they can be queried normally. Commons Configuration 1.4 wasn't affected by this issue.

The following test fails on the last assertion :

public void testSaveWithDataConfiguration() throws ConfigurationException
{
    File file = new File("target/testsave.properties");
    if (file.exists()) {
        assertTrue(file.delete());
    }

    PropertiesConfiguration config = new PropertiesConfiguration(file);

    DataConfiguration dataConfig = new DataConfiguration(config);

    dataConfig.setProperty("foo", "bar");
    assertEquals("bar", config.getProperty("foo"));
    config.save();

    // reload the file
    PropertiesConfiguration config2 = new PropertiesConfiguration(file);
    assertFalse("empty configuration", config2.isEmpty());
}


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Oliver Heger made changes - 31/Jul/08 08:30 PM
Field Original Value New Value
Assignee Oliver Heger [ oliver.heger@t-online.de ]
Oliver Heger made changes - 01/Aug/08 07:48 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Oliver Heger made changes - 22/Aug/09 07:36 PM
Status Resolved [ 5 ] Closed [ 6 ]