[ https://issues.apache.org/jira/browse/CONFIGURATION-486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232022#comment-13232022 ]
Sebb commented on CONFIGURATION-486: ------------------------------------ Fixing the thread-safety issue is trivial. However, the class will still be potentially thread-hostile, depending on when the setter and getter are used. Fixing that might require a redesign of the code. > 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