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 21831

Summary: MultiDataObject is not thread safe
Product: platform Reporter: Chris Webster <cwebster>
Component: Data SystemsAssignee: phamernik <phamernik>
Status: CLOSED FIXED    
Severity: blocker CC: jchalupa, non_migrated_user
Priority: P2 Keywords: THREAD
Version: 3.x   
Hardware: All   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:
Attachments: Suggested new MultiDataObject
Patch jar for FFJ 4.0 FCS

Description Chris Webster 2002-03-23 05:39:51 UTC
MultiDataObject inherits from DataObject; however, MultiDataObject does not
override the synchObject() method. This presents a problem as methods such as
MultiDataObject.delete are synchronized on synchObject, but
MultiDataObject.isDeleteAllowed are synchronized on synchObjectSecondary(). This
can cause ConcurrentModificationException to be thrown from the iterators. I am
attaching a suggested patch to MultiDataObject
Comment 1 Chris Webster 2002-03-23 05:42:12 UTC
Created attachment 5158 [details]
Suggested new MultiDataObject
Comment 2 Chris Webster 2002-03-25 22:16:09 UTC
I tested the MultiDataObject patch and it resolves the concurrent
modification exception which was reported. 
Comment 3 phamernik 2002-03-26 16:06:52 UTC
Chris,

it looks like a bug, but unfortunatelly I can't use your patch. I
think I need to find some other solution. I guess if I use the patch,
it will cause another deadlocks that were fixed by current solution.
(the deadlocks #18110, #17941, maybe others)

I will try to investigate it more.
Comment 4 phamernik 2002-03-28 16:22:53 UTC
The bug is fixed in trunk (with target nb3.4) as revision 1.61. 

The complete diff is available here:
http://www.netbeans.org/source/browse/openide/src/org/openide/loaders/MultiDataObject.java.diff?r1=1.60&r2=1.61&f=H

The bugfix passes the loader unit tests.

Comment 5 phamernik 2002-03-29 17:05:45 UTC
Created attachment 5241 [details]
Patch jar for FFJ 4.0 FCS
Comment 6 phamernik 2002-03-29 17:12:46 UTC
Chris,

I fixed the bug in netbeans trunk yesterday and it looks good now.

I just created the patch jar for FFJ 4.0 FCS build. Please place it in
your FFJ installation folder into /lib/patches directory. It contains
only MultiDataObject classes and should be placed before
openide-compat in the classpath (otherwise please remove
MultiDataObject from openide-compat.jar).

If patch is correctly installed it should print a message on console:
"Running with MultiDataObject patch."

I tested it with latest FFJ build, but I need your feedback. Does it
solve your problems, please?
Let me know, I'd like to integrate it in FFJ as soon as possible,
because this bug fix could have an impact on whole IDE.

thanks.
Comment 7 Chris Webster 2002-04-01 20:38:34 UTC
I tested this bug and the suggested patch appears to work. 
Comment 8 Jan Zajicek 2002-04-02 16:33:27 UTC
Verified for #020401_01.
Comment 9 phamernik 2002-04-03 11:17:53 UTC
Integrated in {pilsen_fcs} branch too. 

org.openide.loaders.MultiDataObject revision 1.56.14.2.4.1

Comment 10 Quality Engineering 2003-07-01 16:18:37 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.