Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 139328 - [Viewers] Widget is Disposed exception in site editor
Summary: [Viewers] Widget is Disposed exception in site editor
Status: RESOLVED DUPLICATE of bug 154571
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2.1   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 113155 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-28 19:47 EDT by Brock Janiczak CLA
Modified: 2006-08-21 13:09 EDT (History)
4 users (show)

See Also:


Attachments
site.xml (774 bytes, text/plain)
2006-04-28 19:47 EDT, Brock Janiczak CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brock Janiczak CLA 2006-04-28 19:47:19 EDT
Version: 3.2.0
Build id: I20060428-1315

The first time you expand a category node in the site editor, the attached exception appear in the log and an empty node appears.  Collapsing and expanding the node again causes the correct nodes to appear.

1. Open the attached site.xml
2. expand the Jira node
3. Observe: An empty node is shown
4. collapse and expand the jira node again
5. Observe: the features now show correctly

I assigned this issue to platform UI since no PDE classes appear in the stacktrace

org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:3374)
    at org.eclipse.swt.SWT.error(SWT.java:3297)
    at org.eclipse.swt.SWT.error(SWT.java:3268)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
    at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:327)
    at org.eclipse.swt.widgets.TreeItem.getItemCount(TreeItem.java:730)
    at org.eclipse.jface.viewers.TreeViewer.getItemCount(TreeViewer.java:432)
    at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2453)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:739)
    at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:716)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:690)
    at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:872)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:1234)
    at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:1246)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:181)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934)
    at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:6217)
    at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:3794)
    at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:1166)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3298)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1842)
    at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1292)
    at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:5137)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:3279)
    at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:4734)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1923)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Brock Janiczak CLA 2006-04-28 19:47:54 EDT
Created attachment 39849 [details]
site.xml
Comment 2 Boris Bokowski CLA 2006-05-05 15:50:37 EDT
Brock, I am not able to reproduce this. Could you download the latest integration build (I20060505-1306) and check if this exception still occurs?  SWT fixed a bug in Tree for this build.

Also, which platform are you using?
Comment 3 Brock Janiczak CLA 2006-05-05 19:29:02 EDT
Sorry, still no go with I20060505-1306.  It only seems to show up once per session.

I am using Windows XP
Comment 4 Boris Bokowski CLA 2006-05-06 00:10:48 EDT
Steve, could this be a bug in SWT?  I don't think anything was changed in TreeViewer or AbstractTreeViewer that could have caused this.  From looking at the code, a new TreeItem is created, then getData() and setData() is called without any problems on the new item, and then getItemCount() is called, which fails at the following line:

if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
Comment 5 Steve Northover CLA 2006-05-09 10:40:46 EDT
If AbstractTreeViewer.updatePlus() is accessing a tree item that has been disposed, and AbstractTreeViewer disposed of the item, then SWT doesn't have a bug.  If the disposed item was accessed by SWT internally, say in Tree.WM_LBUTTONDOWN, then SWT has a bug.

The only think I can think of is that the call to checkData() will send the SWT.SetData callback.  That method will return false if the item or the tree becomes is disposed.  Are you disposing items in SWT.SetData?
Comment 6 Boris Bokowski CLA 2006-05-09 13:16:01 EDT
(In reply to comment #3)
> Sorry, still no go with I20060505-1306.  It only seems to show up once per
> session.
> 
> I am using Windows XP

Wassim, could it be that the label provider for the tree in the site editor causes changes to the tree while the label is being computed?
Comment 7 Wassim Melhem CLA 2006-05-09 15:18:11 EDT
I looked over the label provider code for the site outline.  Very straight forward.  Nothing in there would trigger recomputation of children, etc.
Comment 8 Boris Bokowski CLA 2006-05-09 16:47:39 EDT
(In reply to comment #7)

Did you see anything that might end up in a dialog that reports progress and therefore spins the event loop?

Comment 9 Wassim Melhem CLA 2006-05-09 16:55:01 EDT
Yes there is a chance of that happening.  It may trigger feature model initialization if the outline happens to show up early on in the session.

So there is a chance a NullProgressMonitor gets created in the process.
Comment 10 Boris Bokowski CLA 2006-05-11 02:29:40 EDT
Consider for 3.2.1
Comment 11 Boris Bokowski CLA 2006-05-23 13:58:00 EDT
*** Bug 113155 has been marked as a duplicate of this bug. ***
Comment 12 Tod Creasey CLA 2006-08-16 13:07:37 EDT
Boris if you are not planning to address this for 3.2.1 you should remove the tag. The release candidates start next week.
Comment 13 Boris Bokowski CLA 2006-08-21 13:09:04 EDT
I don't have a reproducible case for this, but I opened a bug for what I think is the general problem.

*** This bug has been marked as a duplicate of 154571 ***