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 41617 - IllegalStateException - warning: going from readAccess to writeAccess
Summary: IllegalStateException - warning: going from readAccess to writeAccess
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
: 40116 40200 41706 41717 45056 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-02 08:47 UTC by Antonin Nebuzelsky
Modified: 2008-12-23 13:35 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IllegalStateException (5.95 KB, text/plain)
2004-04-02 08:48 UTC, Antonin Nebuzelsky
Details
patch (835 bytes, patch)
2004-04-05 16:45 UTC, David Konecny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-04-02 08:47:45 UTC
NB36 RC2, W2K, JDK 142_04

The attached exception was raised when I simply
expanded folders of a VCS filesystem in
Filesystems tab. The ISE raised is a consequence
of changes related to issue 10778.
Comment 1 Antonin Nebuzelsky 2004-04-02 08:48:26 UTC
Created attachment 14252 [details]
IllegalStateException
Comment 2 Jaroslav Tulach 2004-04-02 09:59:45 UTC
The bug is in InstanceDataObject's node. 
Comment 3 Petr Nejedly 2004-04-02 12:10:31 UTC
*** Issue 40116 has been marked as a duplicate of this issue. ***
Comment 4 Petr Nejedly 2004-04-02 12:18:27 UTC
Then we should document that you can't call changeOriginal from inside
readAccess.
Comment 5 Jaroslav Tulach 2004-04-02 12:32:26 UTC
It should be documented. I thought it is, but that is probably only in
setChildren. 
http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/nodes/Node.html#setChildren(org.openide.nodes.Children)
Comment 6 David Konecny 2004-04-02 14:06:15 UTC
*** Issue 40200 has been marked as a duplicate of this issue. ***
Comment 7 David Konecny 2004-04-05 16:45:27 UTC
Created attachment 14281 [details]
patch
Comment 8 David Konecny 2004-04-05 16:53:25 UTC
Jarda or Peter, could you please look at the attached trivial patch
and tell me that it is right solution? I will not pretend I understand
locking in Nodes. It is 

org.openide.explorer.view.TreeView$TreePropertyListener.valueChanged(TreeView.java:933)

who calls

Children.MUTEX.postReadRequest(this);

and as a result InstanceDO code is called. So I simply
Children.MUTEX.postWriteRequest in which I call changeOriginal.

As for the reproduction: I'm always able to reproduce it on whatever
filesystem. Just expand a folder which contains some .settings files
and then select the .setting file. The first time file is selected in
Explorer the exception should be thrown. Second time it is OK.
Comment 9 Jaroslav Tulach 2004-04-06 06:10:03 UTC
Trivial and correct patch.
Comment 10 Petr Nejedly 2004-04-06 08:48:17 UTC
The patch is OK, but I don't understand why is the node changing its
delegate when selected. That complicated stack trace looks fishy.
Comment 11 David Konecny 2004-04-06 09:04:58 UTC
Petr, yes, it is a bit suspicious. Why it happens when .settings file
is selected? Perhaps some lazy initialization?

OK, thanx guys, I'm going to commit the fix. I afraid than we will
receive a lot of bug reports for NB36 with this ISE. But it is too
late to fix it there. This is candidate for NB 3.6.X if there will be
such a release.
Comment 12 David Konecny 2004-04-06 10:39:57 UTC
Fixed in:
Checking in src/org/openide/loaders/InstanceDataObject.java
new revision: 1.10; previous revision: 1.9
Comment 13 Marian Mirilovic 2004-04-06 12:53:33 UTC
David,
don't forget to set appropriate TM if you are closing issue !

Thanks in advance.
Comment 14 Marian Mirilovic 2004-04-06 12:53:43 UTC
*** Issue 41706 has been marked as a duplicate of this issue. ***
Comment 15 Jan Lahoda 2004-04-09 10:58:33 UTC
*** Issue 41717 has been marked as a duplicate of this issue. ***
Comment 16 Jaroslav Tulach 2004-07-27 14:10:01 UTC
*** Issue 45056 has been marked as a duplicate of this issue. ***
Comment 17 Tim Lebedkov 2005-07-21 13:54:13 UTC
4.1 is ready