commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COLLECTIONS-325) Improve thread-safety of ExtendedProperties
Date Wed, 23 Jan 2013 17:11:14 GMT

    [ https://issues.apache.org/jira/browse/COLLECTIONS-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13560832#comment-13560832
] 

Thomas Neidhart commented on COLLECTIONS-325:
---------------------------------------------

Eclipse reports some additional things wrt overriding synchronized methods without proper
synchronization:

 * put
 * putAll
 * remove

We could also just simply state in the javadoc that the class is not thread-safe.

                
> Improve thread-safety of ExtendedProperties
> -------------------------------------------
>
>                 Key: COLLECTIONS-325
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-325
>             Project: Commons Collections
>          Issue Type: Improvement
>            Reporter: Sebb
>
> It looks as though ExtendedProperties is intended to be thread-safe, otherwise why bother
synchronizing load() and save()?
> If so, then ExtendedProperties field "isInitialized" should be made volatile to ensure
the variable is correctly published.
> Likewise, the field "includePropertyName" needs to be volatile or synchronised.
> Also, the following protected variables could be made final to improve thread-safety:
> defaults
> file
> basePath
> fileSeparator - this could perhaps be static too?
> keysAsListed
> Regardless of thread-safety issues, does it make sense for these variables to be changed
once initialised?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message