|
Description
Remy Suen
The focus event is causing an activation which causes the status controls to be recreated. May possibly be related to bug 325834. Thread [main] (Suspended (breakpoint at line 806 in Widget)) ScrolledComposite(Widget).release(boolean) line: 806 ScrolledComposite(Widget).dispose() line: 446 CompilationUnitEditor(StatusTextEditor).updatePartControl(IEditorInput) line: 67 CompilationUnitEditor(StatusTextEditor).sanityCheckState(IEditorInput) line: 239 CompilationUnitEditor(AbstractTextEditor).safelySanityCheckState(IEditorInput) line: 4850 AbstractTextEditor$ActivationListener.handleActivation() line: 983 AbstractTextEditor$ActivationListener.partActivated(IWorkbenchPart) line: 940 PartService.partActivated(IWorkbenchPart) line: 69 WorkbenchPage.firePartActivated(MPart) line: 3034 WorkbenchPage.access$8(WorkbenchPage, MPart) line: 3023 WorkbenchPage$E4PartListener.partActivated(MPart) line: 133 PartServiceImpl.firePartActivated(MPart) line: 167 PartServiceImpl.setPart(MPart) line: 144 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 79 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 Method.invoke(Object, Object...) line: 618 MethodRequestor.execute() line: 52 ContextObjectSupplier$ContextInjectionListener.update(IEclipseContext, int, Object[]) line: 75 TrackableComputationExt.update(ContextChangeEvent) line: 90 EclipseContext.processScheduled(List<Scheduled>) line: 365 EclipseContext.set(String, Object) line: 382 EclipseContext.activate() line: 637 EclipseContext.activateBranch() line: 642 PartActivationHistory.activate(MPart, boolean) line: 51 PartServiceImpl.activate(MPart, boolean, boolean) line: 471 PartServiceImpl.activate(MPart, boolean) line: 453 ContributedPartRenderer(AbstractPartRenderer).activate(MPart) line: 105 ContributedPartRenderer$2.handleEvent(Event) line: 147 EventTable.sendEvent(Event) line: 84 Composite(Widget).sendEvent(Event) line: 1053 Composite(Widget).sendEvent(int, Event, boolean) line: 1077 Composite(Widget).sendEvent(int) line: 1058 Shell.setActiveControl(Control) line: 1424 Composite(Control).sendFocusEvent(int) line: 2635 Composite(Widget).wmSetFocus(int, int, int) line: 2402 Composite(Control).WM_SETFOCUS(int, int) line: 4795 Composite(Control).windowProc(int, int, int, int) line: 4232 Display.windowProc(int, int, int, int) line: 4903 OS.SetFocus(int) line: not available [native method] Composite(Control).forceFocus() line: 995 Composite(Control).setFixedFocus() line: 2983 Composite.setFixedFocus() line: 1039 Composite.setFixedFocus() line: 1037 ScrolledComposite(Composite).setFixedFocus() line: 1037 Composite.setFixedFocus() line: 1037 Composite.setFixedFocus() line: 1037 Composite.setFixedFocus() line: 1037 CTabFolder(Composite).setFixedFocus() line: 1037 Composite(Control).fixFocus(Control) line: 953 Composite(Control).setVisible(boolean) line: 3410 CTabFolder.setSelection(int) line: 2818 CTabFolder.setSelection(int, boolean) line: 2826 CTabFolder.onMouse(Event) line: 1471 CTabFolder$2.handleEvent(Event) line: 266 EventTable.sendEvent(Event) line: 84 CTabFolder(Widget).sendEvent(Event) line: 1053 Display.runDeferredEvents() line: 4083 Display.readAndDispatch() line: 3674 PartRenderingEngine$6.run() line: 772 Realm.runWithDefault(Realm, Runnable) line: 332 PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 681 E4Workbench.createAndRunUI(MApplicationElement) line: 104 Workbench$3.run() line: 545 I got this while I had opened files (all were previously saved though, and were not opened in this session, meaning they were still open the last time I started eclipse) and I closed two projects, this caused some(if not all) of the files to remain open but without content (don't remember what was instead of their content, some message saying their project is closed maybe(?) but this exception was on the Error Log (view): Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl MyFile.java org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4277) at org.eclipse.swt.SWT.error(SWT.java:4192) at org.eclipse.swt.SWT.error(SWT.java:4163) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340) at org.eclipse.swt.widgets.Control.setFocus(Control.java:3288) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1038) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1038) at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:120) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setFocus(JavaEditor.java:2368) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:158) at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:226) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:232) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:203) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:101) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:519) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:488) at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:105) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$ActivationJob.run(StackRenderer.java:133) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4138) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3755) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:944) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:860) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:542) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:522) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) erm, my bad, Comment 2 was meant for this bug instead: https://bugs.eclipse.org/bugs/show_bug.cgi?id=344861 Created attachment 266724 [details]
A Junit test
Attached is a Junit test to reproduce the issue.
To execute:
Put test in /org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/editor
Expose org.eclipse.ui.tests.internal.ExtendedTextEditor.setDocumentProvider() as a public method.
*** Bug 466807 has been marked as a duplicate of this bug. *** (In reply to Vasili Gulevich from comment #4) > Created attachment 266724 [details] > A Junit test > > Attached is a Junit test to reproduce the issue. Thanks! Amazingly, I was just debugging bug 466807. I think both of them are due bug 511873. I see that setFocus() triggers another setFocus() call, and while the outer setFocus() call is still running, the inner one triggers updatePartControl() which disposes the fStatusControl. Bug 511873 is required but not sufficient to fix this one. I have a patch. New Gerrit change created: https://git.eclipse.org/r/90666 Steps to reproduce: 1) Disable "refresh on access" in the workspace 2) Open two java editors on two different java files 3) Close Eclipse 4) Delete the file for editor which was NOT active 5) Start Eclipse (editor for the existing file is active) 6) Click on the tab with deleted file: KABOOM 7) Click previous tab 8) Repeat 6 and 7 to see the error again and again, very nice for debugging. (In reply to Vasili Gulevich from comment #4) > Created attachment 266724 [details] > A Junit test Vasili, I've added your test (slightly modified) to the patch. Any objections? Gerrit change https://git.eclipse.org/r/90666 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=919a0022e6f90d59d48982a7e42141187fc5c594 New Gerrit change created: https://git.eclipse.org/r/91372 Gerrit change https://git.eclipse.org/r/91372 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=f85976cf2deff630448510b18ec517fa21dc9da4 (In reply to Eclipse Genie from comment #13) > Gerrit change https://git.eclipse.org/r/91372 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=f85976cf2deff630448510b18ec517fa21dc9da4 > This reverted the change because the change introduced illegal dependencies. The workbench layer must not refer to ui.editors or ui.ide. New Gerrit change created: https://git.eclipse.org/r/91429 Gerrit change https://git.eclipse.org/r/91429 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=42867e454f548f766bc574e480d3e7dda0f675ea (In reply to Eclipse Genie from comment #16) > Gerrit change https://git.eclipse.org/r/91429 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=42867e454f548f766bc574e480d3e7dda0f675ea > Andrey, please add the copyright notice to StatusEditorTest. New Gerrit change created: https://git.eclipse.org/r/91437 (In reply to Dani Megert from comment #17) > Andrey, please add the copyright notice to StatusEditorTest. Done. (In reply to Eclipse Genie from comment #18) > New Gerrit change created: https://git.eclipse.org/r/91437 This is the missing header which was eaten by JDT while copying the test code from the old patch via clipboard, see bug 512401. Gerrit change https://git.eclipse.org/r/91437 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=5c874dc5531058dfb6d99ed1dda438e1fda3563c Thanks Vasili for test and review, everything should be merged now. Verified in I20170301-2000 with steps from comment 9. |