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 - DataObject.getNodeDelegate has double check locking idiom
Summary: DataObject.getNodeDelegate has double check locking idiom
Status: CLOSED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ ttran
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2002-02-27 22:51 UTC by Chris Webster
Modified: 2008-12-23 10:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.