de-jcup / eclipse-asciidoctor-editor

An eclipse editor for asciidoctor files
https://marketplace.eclipse.org/content/asciidoctor-editor
Other
59 stars 15 forks source link

Unhandled event loop exception - at de.jcup.eclipse.commons.ui.ReducedBrowserInformationControl.isAvailableFor(ReducedBrowserInformationControl.java:128) #331

Open vogella opened 3 years ago

vogella commented 3 years ago

I see the following stack traces in my IDE:

java.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:4856) at org.eclipse.swt.SWT.error(SWT.java:4790) at org.eclipse.swt.SWT.error(SWT.java:4761) at org.eclipse.swt.widgets.Widget.error(Widget.java:555) at org.eclipse.swt.widgets.Widget.checkParent(Widget.java:408) at org.eclipse.swt.widgets.Widget.(Widget.java:284) at org.eclipse.swt.widgets.Control.(Control.java:160) at org.eclipse.swt.widgets.Slider.(Slider.java:115) at de.jcup.eclipse.commons.ui.ReducedBrowserInformationControl.isAvailableFor(ReducedBrowserInformationControl.java:128) at de.jcup.eclipse.commons.ui.ReducedBrowserInformationControlCreator.createInformationControl(ReducedBrowserInformationControlCreator.java:24) at org.eclipse.jface.text.AbstractInformationControlManager.getInformationControl(AbstractInformationControlManager.java:829) at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1138) at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1120) at org.eclipse.jface.text.AbstractInformationControlManager.setInformation(AbstractInformationControlManager.java:431) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:567) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:1101) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:1091) at org.eclipse.jface.text.contentassist.AdditionalInfoController.showInformation(AdditionalInfoController.java:541) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.showInformation(AdditionalInfoController.java:478) at org.eclipse.jface.text.contentassist.AdditionalInfoController$Timer$4.lambda$0(AdditionalInfoController.java:184) at org.eclipse.jface.text.contentassist.AdditionalInfoController$Timer$4$$Lambda$1105/0x000000005e8a3b40.run(Unknown Source) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5067) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4573) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.ui.internal.Workbench$$Lambda$137/0x0000000000000000.run(Unknown Source) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461) at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

de-jcup commented 3 years ago

@vogella : I have problems to understand where the problem exactly lies. Inside eclipse-commons the variable "parent" is used already as parent for created browser element (it's the composite used in editor).

            Slider sliderV = new Slider(parent, SWT.VERTICAL);

https://github.com/de-jcup/eclipse-commons/blob/693bd2fe5d2e3faadb465519e613f0f1c8905f99/src/main/java-eclipse/de/jcup/eclipse/commons/ui/ReducedBrowserInformationControl.java#L128

Has something changed in SWT (IMHO I think we could have different SWT versions) ?

My SWT sources say:

void checkParent (Widget parent) {
    if (parent == null) error (SWT.ERROR_NULL_ARGUMENT);
    if (parent.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
    parent.checkWidget ();
    parent.checkOpen ();
}

So, only when parent is disposed there should be an error with invalid argument. But when parent is disposed, the browser object should not be able to be created. On the other hand, i dispose the browser object before because I created it only temporary to check conditions - could this dispose the parent as well ?!?!?!

@vogella Maybe you could make a recommendation what I should change in the mentioned code at de-jcup/eclipse-commons? Also it would be interesting how many times this appears and when. I fetch any SWT error inside isAvailableFor so I don't get it, why this exceptions is showing up at all.

de-jcup commented 3 years ago

@vogella : any updates here? Please look at my questions before