You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (Commented) (JIRA)" <ji...@apache.org> on 2012/03/17 17:51:39 UTC

[jira] [Commented] (CONFIGURATION-486) BeanHelper.setDefaultBeanFactory() is thread-hostile and not thread-safe

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

Oliver Heger commented on CONFIGURATION-486:
--------------------------------------------

Agreed. Do you want to go ahead and fix this?
                
> BeanHelper.setDefaultBeanFactory() is thread-hostile and not thread-safe
> ------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-486
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-486
>             Project: Commons Configuration
>          Issue Type: Bug
>            Reporter: Sebb
>
> BeanHelper.setDefaultBeanFactory() sets a private static field.
> This is thread-hostile, because different threads cannot safely use different factories.
> It's also not thread-safe, as the variable is not guaranteed to be published safely.
> Should either make the variable volatile, or synchronize both getter and setter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira