[ 
http://issues.apache.org/jira/browse/CONFIGURATION-223?page=comments#action_12431362
 ] 
            
Oliver Heger commented on CONFIGURATION-223:
--------------------------------------------

Thanks for the patch, this is really helpful. I changed 
AbstractFileConfiguration in the way mentioned above and everything seems to 
work. I will do some more testing.

You are right that the behavior of these methods is now slightly different, but 
in this case I think it is an improvement. Calling addProperty() or 
setProperty() is now considered a single change and will result in only one 
auto save operation. This is fine IMO.

Sorry for your JMX work. What makes me worrying is the fact that this 
significant bug was not detected by our unit test suite, though we have a 
pretty high code coverage. Obviously there is still room for improvement.

> PropertiesConfigurationLayout broke the autoSave behaviour of 
> PropertiesConfiguration
> -------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-223
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-223
>             Project: Commons Configuration
>          Issue Type: Bug
>         Environment: 1.3RC1
>            Reporter: Gabriele Garuglieri
>         Assigned To: Oliver Heger
>            Priority: Critical
>         Attachments: 223-test.patch
>
>
> When using  PropertiesConfiguration with autoSave "true" the 
> PropertiesConfigurationLayout causes invalid properties files to be saved.
> When using addProperty("key", "value"); where key does not exist yet in the 
> configuration the EVENT_ADD_PROPERTY event that updates the 
> PropertiesConfigurationLayout with the new "key" is issued only after the 
> possiblySave() method is invoked so the new property will not be saved.
> When using setProperty("key", "value"); where key does not exist yet in the 
> configuration the EVENT_SET_PROPERTY event that updates the 
> PropertiesConfigurationLayout with the new "key" is issued only after the 
> possiblySave() method is invoked so the new property will not be saved.
> The way it is implemented now makes content of the saved file depending on 
> PropertiesConfigurationLayout content that depends on an event that will be 
> issued only after the file was properly updated. This creates a circular 
> dependency that cannot work.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to