This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 20980

Summary: DataObject.getNodeDelegate has double check locking idiom
Product: platform Reporter: Chris Webster <cwebster>
Component: Data SystemsAssignee: _ ttran <ttran>
Status: CLOSED WORKSFORME    
Severity: blocker Keywords: THREAD
Priority: P3    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Chris Webster 2002-02-27 22:51:42 UTC
I was looking at the code for DataObject.getNodeDelegate() and I noticed the
following construct:

if (nodeDelegate == null) {

   getPrimaryFileListener() ... which eventually ends up calling
   synchronized (fileListener) {
	if (nodeDelegate == null) {
           nodeDelegate = ...;
        }
   }
}
which is the double check locking idiom which could potentially cause threading
problems. The refactoring is to perform the initial test in a synchronized
block.
Comment 1 _ ttran 2002-02-28 11:51:10 UTC
added THREAD keyword
Comment 2 _ ttran 2002-02-28 13:14:00 UTC
I don't see this construct in CVS trunk anymore.  The faulty code has
disappeared as part of other commits
Comment 3 Quality Engineering 2003-07-01 15:53:22 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 4 Quality Engineering 2003-07-01 16:33:53 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.