Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Auto Closed
-
None
-
None
-
None
-
None
-
Patch
Description
http://www.cs.umd.edu/%7Epugh/java/memoryModel/DoubleCheckedLocking.html
public BeanManagerImpl getBeanManagerImpl() { if (bm == null) { // should be done in the constructor synchronized (this) { if (bm == null) { bm = new WebappBeanManager(this); } } } return bm; }
Unless *bm* is volatile, multiple instances of the bean manager can be created under concurrent conditions.
PS: I saw the suppress warning. I'm not sure if PMD just warns against DCL or that it was broken.
Attachments
Issue Links
- links to