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

Bug 559368

Summary: "Widget is disposed" error in AbstractCSSSWTEngineImpl.isStylable
Product: [Eclipse Project] Platform Reporter: Peter Billstrom <peter.billstrom>
Component: UIAssignee: Peter Billstrom <peter.billstrom>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laeubi, Lars.Vogel, loskutov, peter.billstrom
Version: 4.14   
Target Milestone: 4.15 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/156323
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e4d2ebba02d40570f7aa834c6c2037ef6c25017b
Whiteboard:

Description Peter Billstrom CLA 2020-01-21 06:24:19 EST
Note: I wasn't sure which version to specify. We are using the lib org.eclipse.e4.ui.css.swt, version 0.13.200.v20180828-0227.

We are using MPartStack to create tabs. One of the parts is an MCompositePart which contains another MPartStack in order for us to have nested tabs. The problem is that when an user closes the parent tab an exception is thrown:

org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4595)
	at org.eclipse.swt.SWT.error(SWT.java:4510)
	at org.eclipse.swt.SWT.error(SWT.java:4481)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:451)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:350)
	at org.eclipse.swt.widgets.Widget.getData(Widget.java:544)
	at org.eclipse.e4.ui.css.swt.engine.AbstractCSSSWTEngineImpl.isStylable(AbstractCSSSWTEngineImpl.java:116)
	at org.eclipse.e4.ui.css.swt.engine.AbstractCSSSWTEngineImpl.getElement(AbstractCSSSWTEngineImpl.java:96)
	at org.eclipse.e4.ui.css.core.dom.ArrayNodeList.item(ArrayNodeList.java:43)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:435)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:364)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:435)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:364)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:435)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:364)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:435)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:364)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$8.setClassnameAndId(PartRenderingEngine.java:1392)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.setCSSInfo(SWTPartRenderer.java:114)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.styleElement(SWTPartRenderer.java:84)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.subscribeTopicActivateChanged(StackRenderer.java:536)
	at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	... 83 more
Comment 1 Peter Billstrom CLA 2020-01-21 06:28:20 EST
Perhaps AbstractCSSSWTEngineImpl.isStylable(Widget) should return false instead of throwing an exception if the widget is disposed?

I've made a pull request here: https://github.com/eclipse/eclipse.platform.ui/pull/37
Comment 2 Andrey Loskutov CLA 2020-01-21 07:10:45 EST
(In reply to Peter Billstrom from comment #1)
> Perhaps AbstractCSSSWTEngineImpl.isStylable(Widget) should return false
> instead of throwing an exception if the widget is disposed?
> 
> I've made a pull request here:
> https://github.com/eclipse/eclipse.platform.ui/pull/37

Thanks for report & patch, but can you please use Gerrit?
See https://wiki.eclipse.org/Platform/How_to_Contribute
Comment 3 Eclipse Genie CLA 2020-01-22 07:15:43 EST
New Gerrit change created: https://git.eclipse.org/r/156323
Comment 5 Lars Vogel CLA 2020-01-22 17:06:08 EST
Thanks Peter
Comment 6 Christoph Laeubrich CLA 2020-05-28 07:18:53 EDT
*** Bug 538231 has been marked as a duplicate of this bug. ***