Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 300683

Summary: SWTException: Widget is disposed in JEE5ContentProvider
Product: [WebTools] WTP Java EE Tools Reporter: Xu XIANG <xu.xiang>
Component: jst.j2eeAssignee: jst.j2ee <jst.j2ee-inbox>
Status: CLOSED DUPLICATE QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Xu XIANG CLA 2010-01-25 09:53:45 EST
Build Identifier: 20090920-1017

Caused by: org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3884)
	at org.eclipse.swt.SWT.error(SWT.java:3799)
	at org.eclipse.swt.SWT.error(SWT.java:3770)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:336)
	at org.eclipse.swt.widgets.Tree.setRedraw(Tree.java:4715)
	at org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider$1.run(JEE5ContentProvider.java:166)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 40 more



The implementation of the method
org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider.projectChanged(IProject)
looks questionable to me:

1) Why should a content provider trigger the viewer refresh? Is here the right place for this logic?

2) If you do the refresh asynchronously (line 171): Display.getDefault().asyncExec(refreshThread) you should always verify whether the controls are still valid to prevent such SWTException ("Widget is disposed")


Reproducible: Sometimes
Comment 1 Carl Anderson CLA 2010-01-25 16:23:31 EST

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