Project: Eclipse_Platform_UI
Bug 352076 [Compatibility] Exception caused by having the 'XPath' view open prevents Ctrl+W from operating
Reported: 2011-07-14 09:04:12 | Status: verified fixed

1. Open the 'XPath' view. 2. Create a DTD file. 3. An exception will occur after the editor opens. At this point, either the active stack will no longer be updated. Ctrl+W may work, but it will stop working when you reopen the editor. Using a new window seems to work but the active stack colouring is still not present. java.lang.NullPointerException at org.eclipse.wst.xml.xpath.ui.internal.views.XPathComputer.updateExpression(XPathComputer.java:122) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathComputer.setText(XPathComputer.java:146) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.recomputeXPath(XPathView.java:293) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.editorActivated(XPathView.java:378) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.access$5(XPathView.java:368) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView$XPathPartListener.partActivated(XPathView.java:464) at org.eclipse.ui.internal.WorkbenchPage$11.run(WorkbenchPage.java:3825) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:3823) at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:3804) at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:161) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:187) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.setPart(PartServiceImpl.java:161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.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:56) at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:76) at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:91) at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:326) at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:343) at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:596) at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:601) at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:529) 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.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1447) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2836) at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2403) at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5152) at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:448) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4598) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985) at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1098) at org.eclipse.swt.widgets.Control.setFocus(Control.java:3303) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1040) at org.eclipse.ui.texteditor.AbstractTextEditor.setFocus(AbstractTextEditor.java:6189) at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:122) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.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:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:228) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:234) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:205) 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.PartServiceImpl.activate(PartServiceImpl.java:477) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2734) at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:2654) at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2636) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2632) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2612) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2603) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard$2.run(NewDTDWizard.java:223) 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:4140) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) 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:89) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:539) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:519) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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) !ENTRY org.eclipse.e4.ui.workbench 4 0 2011-07-14 08:59:00.421 !MESSAGE Error setting focus to : org.eclipse.e4.ui.model.application.ui.basic.impl.PartImpl NewFile.dtd !STACK 0 org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63) at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:76) at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:91) at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:326) at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:343) at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:596) at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:601) at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.activate(PartActivationHistory.java:52) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:529) 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.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058) at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1447) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2836) at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2403) at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5152) at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:448) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4598) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985) at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method) at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1098) at org.eclipse.swt.widgets.Control.setFocus(Control.java:3303) at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1040) at org.eclipse.ui.texteditor.AbstractTextEditor.setFocus(AbstractTextEditor.java:6189) at org.eclipse.ui.texteditor.StatusTextEditor.setFocus(StatusTextEditor.java:122) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.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:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:228) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:234) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:205) 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.PartServiceImpl.activate(PartServiceImpl.java:477) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2734) at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:2654) at org.eclipse.ui.internal.WorkbenchPage$7.run(WorkbenchPage.java:2636) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2632) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2612) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2603) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.wst.dtd.ui.internal.wizard.NewDTDWizard$2.run(NewDTDWizard.java:223) 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:4140) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757) 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:89) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:539) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:519) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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) Caused by: java.lang.NullPointerException at org.eclipse.wst.xml.xpath.ui.internal.XPathUIPlugin.getNamespaceInfo(XPathUIPlugin.java:153) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathComputer.updateNamespaces(XPathComputer.java:217) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathComputer.updateExpression(XPathComputer.java:123) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathComputer.setText(XPathComputer.java:146) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.recomputeXPath(XPathView.java:293) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.recalculateLocation(XPathView.java:283) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView.access$2(XPathView.java:279) at org.eclipse.wst.xml.xpath.ui.internal.views.XPathView$1.selectionChanged(XPathView.java:90) at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:163) at org.eclipse.ui.internal.e4.compatibility.SelectionService.updateSelection(SelectionService.java:108) at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:167) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:187) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.setPart(PartServiceImpl.java:161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.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:56) ... 77 more

Files changed in fix:
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java