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 17020 - Restore sloppy behavior of DataObject.getNodeDelegate
Summary: Restore sloppy behavior of DataObject.getNodeDelegate
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 16378
  Show dependency tree
 
Reported: 2001-10-26 11:22 UTC by Jesse Glick
Modified: 2013-06-22 02:06 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-10-26 11:22:00 UTC
To avoid possible problems caused by race conditions, DataObject.getNodeDelegate
should be changed to quietly return a value even when the object is invalid--or
log some stack trace to logfile, but still return normally. This might not be
trivial as the synchronization logic currently assumes a valid object (pool
item).
Comment 1 Vitezslav Stejskal 2001-10-26 13:36:16 UTC
I discussed this with Yarda some time ago. The only reason why the Item is involved in the process is 
that you need to pass Runnable in Children.MUTEX call in getNodeDelegate(). They decided to implement 
Runnable by Item instead of creating new inner class, there shouldn't be any other relationship from the 
point of view of node delegate construction. Jesse, if you want me to do this, just reassign it to me.
Comment 2 Jesse Glick 2001-10-26 20:20:45 UTC
I know the Item is Runnable. It also provides a synch lock though,
this needs to be replaced. I will do it.
Comment 3 Jesse Glick 2001-10-30 20:33:41 UTC
Have a patch.
Comment 4 Jesse Glick 2001-10-30 20:46:43 UTC
Should be fixed now: if you call getNodeDelegate and the data object
is invalid, it ought to log an exception but return normally. Reused
the primaryFileListener for synchronization purposes without adding an
extra field etc.

committed   * Up-To-Date  1.63       
openide/src/org/openide/loaders/DataObject.java
committed   * Up-To-Date  1.53       
openide/src/org/openide/loaders/DataObjectPool.java
committed   * Up-To-Date  1.6        
openide/test/unit/src/org/openide/loaders/DataObjectInvalidationTest.java
Comment 5 dmladek 2002-05-07 13:05:10 UTC
  Product Version       = NetBeans IDE Development Version (Build
200205070100)
  IDE Versioning        = IDE/1 spec=2.17 impl=200205070100
  Operating System      = Linux version 2.4.18 running on i386
  Java; VM; Vendor      = 1.4.1-beta; Java HotSpot(TM) Client VM
1.4.1-beta-b10; Sun Microsystems Inc.
  Java Home             = /usr/java/j2sdk1.4/sun/jdk1.4.1/jre
  System Locale; Encod. = cs_CZ; ISO-8859-2
=====================================================================

I've receive IllegalStateException when switching between Projects in
the IDE.

Here is a short stacktrace of ISE:
*********** Exception occurred ************ at Tue May 07 13:55:45
CEST 2002
java.lang.IllegalStateException: The data object
org/netbeans/modules/vcscore is invalid; you may not call
getNodeDelegate on it any more; see #17020 and please fix your code
[catch] at
org.openide.loaders.DataObject.getNodeDelegate(DataObject.java:249)
        at
org.openide.loaders.DataShadow$ShadowNode.originalChanged(DataShadow.java:929)
        at
org.openide.loaders.DataShadow$ShadowNode.access$100(DataShadow.java:572)
        at org.openide.loaders.DataShadow.setOriginal(DataShadow.java:528)
        at org.openide.loaders.DataShadow.access$300(DataShadow.java:42)
        at org.openide.loaders.DataShadow$4.run(DataShadow.java:563)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)


Comment 6 Jesse Glick 2002-05-07 18:28:28 UTC
No, this bug is still fixed. As the exception message says, some
*other* code is broken. Filed as issue #23225.
Comment 7 dmladek 2002-05-09 11:49:49 UTC
OK and thank you
Comment 8 Quality Engineering 2003-07-01 16:18:58 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.
Comment 9 Marek Fukala 2008-09-08 10:35:26 UTC
*** Issue 143681 has been marked as a duplicate of this issue. ***
Comment 10 Marek Fukala 2008-09-08 10:36:04 UTC
reopening accidentally close issue 
Comment 11 Marek Fukala 2008-09-08 10:37:08 UTC
closing
Comment 12 Quality Engineering 2008-09-22 17:26:33 UTC
Integrated into 'main-golden', will be available in build *200809221401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b62787709153
User: Marek Fukala <mfukala@netbeans.org>
Log: #143681 - IllegalStateException: The data object /local/qa_beetle/dashboards/SatisfactionSurvayCharts/SatisfactionSurveyCharts.html is invalid; you may not call getNodeDelegate on it any more; see #17020 and pl
Comment 13 Quality Engineering 2013-06-22 02:06:35 UTC
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/15860a52948f
User: Marek Fukala <mfukala@netbeans.org>
Log: fixed java.lang.IllegalStateException: The data object XXX is invalid; you may not call getNodeDelegate on it any more; see #17020 and please fix your code.