Bug 182697 - ProjectTab.restoreTreeView() manipulates Swing components from RP thread
ProjectTab.restoreTreeView() manipulates Swing components from RP thread
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Generic Projects UI
6.x
Macintosh (x86) Mac OS X
: P2 (vote)
: 6.x
Assigned To: Jesse Glick
issues@projects
: RANDOM, THREAD
: 181056 (view as bug list)
Depends on:
Blocks: 182695
  Show dependency treegraph
 
Reported: 2010-03-24 17:10 UTC by _ tboudreau
Modified: 2010-04-01 14:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2010-03-24 17:10:36 UTC
See thread dump attached to deadlock bug 182695

"Load Open Projects" daemon prio=1 tid=0x00000001438c7800 nid=0x15feff000 waiting for monitor entry [0x000000015fefe000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at java.awt.Container.remove(Container.java:1195)
	- waiting to lock <0x0000000108896600> (a java.awt.Component$AWTTreeLock)
	at org.netbeans.modules.project.ui.ProjectTab.restoreTreeView(ProjectTab.java:645)
	at org.netbeans.modules.project.ui.ProjectTab.propertyChange(ProjectTab.java:624)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at org.netbeans.modules.project.ui.OpenProjectsTrampolineImpl.propertyChange(OpenProjectsTrampolineImpl.java:108)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.updateGlobalState(OpenProjectList.java:369)
	at org.netbeans.modules.project.ui.OpenProjectList$LoadOpenProjects.run(OpenProjectList.java:320)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1356)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1894)
Comment 1 Jesse Glick 2010-03-24 18:53:06 UTC
Surely not a P1, or there would have been other complaints long ago.
Comment 2 Jesse Glick 2010-03-24 19:02:21 UTC
core-main #306ab7682e60
Comment 3 Quality Engineering 2010-03-25 05:55:24 UTC
Integrated into 'main-golden', will be available in build *201003250201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/306ab7682e60
User: Jesse Glick <jglick@netbeans.org>
Log: #182697: manipulate AWT components on EQ only.
Comment 4 Jesse Glick 2010-03-31 21:56:58 UTC
*** Bug 181056 has been marked as a duplicate of this bug. ***
Comment 5 _ tboudreau 2010-04-01 07:03:37 UTC
Don't you want this line
+            final boolean someProjectsOpen = OpenProjects.getDefault().getOpenProjects().length > 0;
+            Mutex.EVENT.readAccess(new Runnable() {
+                public @Override void run() {
to be here?
+                    if (someProjectsOpen) {
+                        restoreTreeView();
+                    } else {
+                        showNoProjectsLabel();
+                    }
+                }
+            });
It's at least theoretically possible the value can change before the Runnable executes.
Comment 6 Jesse Glick 2010-04-01 14:36:05 UTC
(In reply to comment #5)
> the value can change before the Runnable executes.

It could, in which case I should get a new event and it should repaint. Just preferred to do the calculation outside EQ; not sure if it matters.


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