Bug 147492 - Override DataObject.getLookup()
Override DataObject.getLookup()
Status: RESOLVED FIXED
Product: ide
Classification: Unclassified
Component: Code
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Andrei Badea
issues@ide
:
Depends on: 147893 147890
Blocks: 98197 146072
  Show dependency treegraph
 
Reported: 2008-09-17 14:36 UTC by Andrei Badea
Modified: 2008-09-24 12:46 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Fixes to all DO's except those in the xml cluster (25.70 KB, text/plain)
2008-09-17 14:51 UTC, Andrei Badea
Details
Fixes to all DO's including those in the xml cluster (37.55 KB, text/plain)
2008-09-17 17:14 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2008-09-17 14:36:12 UTC
The default implementation of DataObject.getLookup() acquires Children.MUTEX, which is deadlock-prone (as documented in
the method's Javadoc). All DataObject's in netbeans.org modules should implement this method in a safer way, usually by
simply returning getCookieSet().getLookup(). However, this approach does not work for DO's returning extra cookies by
overriding DO.getCookie(). Such DO's can be fixed to create the extra cookies through CookieSet.Factory.
Comment 1 Andrei Badea 2008-09-17 14:51:03 UTC
Created attachment 70039 [details]
Fixes to all DO's except those in the xml cluster
Comment 2 Andrei Badea 2008-09-17 14:53:15 UTC
Some DO's required changes to the cookie registration. I would like to ask for reviews of the changes to these DO's.
They are:

form: PaletteItemDataObject
java.source: ClassDataObject
properties: PropertiesDataObject
web.core: JspServletDataObject
Comment 3 Jan Stola 2008-09-17 16:00:22 UTC
The changes in PaletteItemDataObject seem to be correct and harmless. Feel free to apply them.
Comment 4 Andrei Badea 2008-09-17 17:14:07 UTC
Created attachment 70054 [details]
Fixes to all DO's including those in the xml cluster
Comment 5 Andrei Badea 2008-09-17 17:22:26 UTC
I would also like to ask for reviews for changes to the following DO's in the loaders-complete.diff attachment:

bpel.core: BPELDataObject
xml.schema: SchemaDataObject
xml.wsdlui: WSDLDataObject
xsl: XSLDataObject
xslt.core: XSLTDataObject, XSLDataObject
xlst.tmap: TMapDataObject
Comment 6 Andrei Badea 2008-09-17 17:23:33 UTC
I intend to commit loaders-complete.diff on Friday September 19.
Comment 7 Samaresh Panda 2008-09-18 14:02:37 UTC
xml.schema change looks good to me.
Comment 8 Andrei Badea 2008-09-19 12:09:40 UTC
main#7004098454c7

I will also look at the DO's in contrib next week, so leaving open. But I think the fix of issue 146072 doesn't need to
wait for that.
Comment 9 Quality Engineering 2008-09-19 17:35:51 UTC
Integrated into 'main-golden', will be available in build *200809191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7004098454c7
User: Andrei Badea <abadea@netbeans.org>
Log: #147492: Override DataObject.getLookup()
Comment 10 Andrei Badea 2008-09-22 15:36:50 UTC
Fixed most *DataObject.java in main/contrib in contrib#2ec16a844efe. 

Skipped the following:

clazz/src/org/netbeans/modules/clazz/ClassDataObject.java
clazz/src/org/netbeans/modules/clazz/CompiledDataObject.java
clazz/src/org/netbeans/modules/clazz/SerDataObject.java

(The whole module looks broken.)

corba/src/org/netbeans/modules/corba/IDLDataObject.java
corba/src/org/netbeans/modules/corba/ioranalyzer/IORDataObject.java

(The whole module looks broken.)

docbook/src/org/netbeans/modules/docbook/DocBookDataObject.java
docbook/src/org/netbeans/modules/docbook/resources/solbook/SolBookDataObject.java

(Instances are added to the lookup of the node delegate, so the default DO.getLookup() does the right thing -- except
for acquiring Children.MUTEX. Probably need to add those instances to the DO's CookieSet using CookieSet.assign(). Filed
issue 147890.)

other/povray/povray/src/org/netbeans/modules/povray/PovRayDataObject.java

(Adds cookie to the node delegate. Also, the modules looks outdated and unmaintained.)

prefsettings/src/org/netbeans/modules/prefsettings/PrefsDataObject.java

(Was afraid to touch this because of the complex logic of getNodeDelegate(). The module is not in cluster.experimental,
so probably not used anymore?)

tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/TaskListDataObject.java

(Overrides DO.getCookie() for a weird purpose. Filed issue 147893.)
Comment 11 Andrei Badea 2008-09-22 15:37:56 UTC
Marking as fixed.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo