| Summary: | [Compatibility] renderers for the XSD editor cause Problems view timerExec to NPE | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Paul Webster <pwebster> | ||||
| Component: | UI | Assignee: | Eric Moffatt <emoffatt> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | emoffatt, keith.chong.ca, Mike_Wilson, remy.suen, thatnitind | ||||
| Version: | 4.1 | ||||||
| Target Milestone: | 4.2 M7 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 334303 | ||||||
| Attachments: |
|
||||||
|
Description
Paul Webster
The XSD editor is building its model of the XSD, and the busyCursorWhile(*) eventually leads to a display dispatch loop which allows the IDE timerExec(*) to run. at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970) at org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter.createSchema(XSDModelAdapter.java:135) at org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter.lookupOrCreateSchema(XSDModelAdapter.java:213) at org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor.buildModel(InternalXSDMultiPageEditor.java:247) at org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor.createPages(ADTMultiPageEditor.java:173) at org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor.createPages(InternalXSDMultiPageEditor.java:568) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:358) If you bring up 4.1 and the XSD is not restored, you don't have the startup problem. However, clicking on the tab brings us: java.lang.NullPointerException at org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor.pageChange(ADTMultiPageEditor.java:242) at org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor.pageChange(InternalXSDMultiPageEditor.java:1191) at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:292) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2745) at org.eclipse.swt.custom.CTabFolder.onFocus(CTabFolder.java:1314) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:253) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:3575) at org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:2938) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1738) at org.eclipse.swt.widgets.Control.windowProc(Control.java:5016) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4408) at org.eclipse.swt.internal.gtk.OS._gtk_widget_grab_focus(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_widget_grab_focus(OS.java:12928) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2320) at org.eclipse.swt.widgets.Composite.forceFocus(Composite.java:526) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2313) at org.eclipse.swt.widgets.Control.setFocus(Control.java:3944) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1373) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1371) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1371) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:105) at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations.java:507) at org.eclipse.swt.widgets.Shell.setEnabled(Shell.java:1750) at org.eclipse.ui.internal.progress.ProgressManager.setUserInterfaceActive(ProgressManager.java:1258) at org.eclipse.ui.internal.progress.ProgressManager.access$4(ProgressManager.java:1252) at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:966) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970) at org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter.createSchema(XSDModelAdapter.java:135) at org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter.lookupOrCreateSchema(XSDModelAdapter.java:213) at org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor.buildModel(InternalXSDMultiPageEditor.java:247) at org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor.createPages(ADTMultiPageEditor.java:173) at org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor.createPages(InternalXSDMultiPageEditor.java:568) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:358) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:122) at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:45) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:828) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:808) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:108) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:310) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:237) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:153) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:64) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:858) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:612) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:714) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:685) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:679) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:664) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:686) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4330) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:182) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:75) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$4.widgetSelected(StackRenderer.java:589) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061) at org.eclipse.e4.ui.widgets.CTabFolder.setSelection(CTabFolder.java:2998) at org.eclipse.e4.ui.widgets.CTabFolder.onMouse(CTabFolder.java:1707) at org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:270) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:969) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:885) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:87) The good news: Double clicking on the file to restore the editor, the editor comes up fine. Clicking on the tab to instantiate does cause a problem. PW The problem seems to be that we're in the process of creating the part: org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141) Then we allow the client code (which may or may not spin the event loop) back into the CPR to call a setFocus() call: org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$2.setFocus(ContributedPartRenderer.java:105) PW I've opened bug 349305 for comment #2 and comment #4 This bug should be about the workbench startup where the Problems view timer exec causes NPEs. PW Created attachment 197951 [details]
Workbench patch v1
An illustrative patch to change the code so that the workbench only reports that it's running if the StartupMonitor is notified.
Even if we did some more hacking and got the renderer to generate the widget properly, our DI engine will choke and terminate the creation process because it will have detected that we're in a recursive loop. This is because the creation of the second view is contained within the call stack of the first view and is interpreted as recursion. (In reply to comment #7) > This is because the creation of the second view is contained within the call > stack of the first view and is interpreted as recursion. This is not a problem on 3.x. You can show another view while you are in your own view's createPartControl(*) method. Note that your own view will remain the active view and the other view does not get activated. Remy, if we were to use the view id as the 'lock' for the recursion test couldn't we detect that this case is not really recursing ? (In reply to comment #9) > Remy, if we were to use the view id as the 'lock' for the recursion test > couldn't we detect that this case is not really recursing ? The DI engine knows nothing about the model. Unless you have something else in mind. I've just been kicking this around and can't seem to reproduce the problem. I may be missing something in the startup case since there's a lot of junk in the error log but certainly I don't see any errors when clicking on an XSD editor that hasn't been instantiated yet... I'm not longer able to reproduce this either. PW As per Paul's comment I'll presume that this has been fixed by the recent work... Paul, should we just verify this ? Yes, let's go ahead and verify PW Verified in I20120503-1800. At least the given scenario no longer gives the exception... |