commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-486) BeanHelper.setDefaultBeanFactory() is thread-hostile and not thread-safe
Date Wed, 14 Mar 2012 22:18:40 GMT
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

        

Mime
View raw message