Removing messages from MessageManager may throw Exception [message #1791757] |
Wed, 04 July 2018 21:08  |
Eclipse User |
|
|
|
I've just seen an exception in my test environment
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3708) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.SWT.error(SWT.java:3631) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.SWT.error(SWT.java:3602) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.widgets.Widget.error(Widget.java:1018) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:397) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.widgets.Widget.isValidThread(Widget.java:972) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:955) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.swt.internal.widgets.ControlDecorator.setText(ControlDecorator.java:71) ~[org.eclipse.rap.rwt_3.2.0.20161006-0240.jar:?]
at org.eclipse.jface.fieldassist.ControlDecoration.setDescriptionText(ControlDecoration.java:922) ~[org.eclipse.rap.jface_3.2.0.20160811-0840.jar:?]
at org.eclipse.ui.internal.forms.MessageManager$ControlDecorator.update(MessageManager.java:275) ~[org.eclipse.rap.ui.forms_3.2.0.20160811-0840.jar:?]
at org.eclipse.ui.internal.forms.MessageManager$ControlDecorator.removeMessages(MessageManager.java:269) ~[org.eclipse.rap.ui.forms_3.2.0.20160811-0840.jar:?]
at org.eclipse.ui.internal.forms.MessageManager.removeAllMessages(MessageManager.java:429) ~[org.eclipse.rap.ui.forms_3.2.0.20160811-0840.jar:?]
How exactly this happened, I don't know. That exception was thrown on the UIThread.
I looked at the code in ControlDecorator and the commented out original code has a check for disposed controls in the commented up #update method.
public void setDescriptionText(String text) {
// this.descriptionText = text;
// update();
// RAP [if]
decorator.setText( text );
}
//
// /**
// * Something has changed, requiring redraw. Redraw the decoration and update
// * the hover text if appropriate.
// */
// protected void update() {
// if (control == null || control.isDisposed()) {
// return;
// }
...
decorator.setText does a disposed check and throws an SWTException.
The commented out method from the original JFace code does a disposed check and silently returns, no exceptions.
Any reason RAP throws an exception in a case where RCP wouldn't?
I don't know how the tester caused this issue and I don't know how to reliably reproduce it.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04904 seconds