Community
Participate
Working Groups
1113 java.lang.NullPointerException at org.eclipse.ui.views.navigator.ResourceNavigator.setFocus (ResourceNavigator.java:670) at org.eclipse.ui.internal.WorkbenchPage$1.run(WorkbenchPage.java:119) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:812) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.ui.internal.WorkbenchPage.activatePart (WorkbenchPage.java:116) at org.eclipse.ui.internal.WorkbenchPage.setActivePart (WorkbenchPage.java:1400) at org.eclipse.ui.internal.WorkbenchPage.closeAllEditors (WorkbenchPage.java:393) at org.eclipse.ui.internal.WorkbenchPage.dispose(WorkbenchPage.java:538) at org.eclipse.ui.internal.WorkbenchWindow.closeAllPages (WorkbenchWindow.java:316) at org.eclipse.ui.internal.WorkbenchWindow.hardClose (WorkbenchWindow.java:591) at org.eclipse.ui.internal.WorkbenchWindow.busyClose (WorkbenchWindow.java:261) at org.eclipse.ui.internal.WorkbenchWindow.access$3 (WorkbenchWindow.java:252) at org.eclipse.ui.internal.WorkbenchWindow$1.run (WorkbenchWindow.java:292) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.ui.internal.WorkbenchWindow.close (WorkbenchWindow.java:290) at org.eclipse.jface.window.WindowManager.close(WindowManager.java:103) at org.eclipse.ui.internal.Workbench$2.run(Workbench.java:101) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:812) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:99) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:77) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:159) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.ui.internal.Workbench.close(Workbench.java:157) at org.eclipse.ui.internal.QuitAction.run(QuitAction.java:31) at org.eclipse.jface.action.Action.runWithEvent(Action.java:453) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1365) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1167) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:729) at org.eclipse.ui.internal.Workbench.run(Workbench.java:712) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at SlimLauncher.main(SlimLauncher.java:14)
The NullPointerException occurs on the following line: getTreeViewer().getTree().setFocus(); Although it is impossible to say, I think this scenario occurs because the the navigator control has never been instantiated.
*** Bug 5905 has been marked as a duplicate of this bug. ***
*** Bug 5956 has been marked as a duplicate of this bug. ***
To duplicate: 1. Close all pages in window. 2. Open new page. Remove all views except Navigator. Open a file editor, and make sure it has focus. 3. Open another new page. 4. Exit workbench. 5. Restart workbench. Notice that second page is active. 6. Exit workbench. Result: Same Exception as PR. In step 5 we recreate the workbench. The parts in the first page are recreated, but their controls are not. In step 6 we exit the workbench. In the process we close all editors in the first page. One of them is active, so, after closing it, we try to activate a new part. The navigator is chosen. In the process of activation we set focus to the navigator, but the navigator has no control, so the NPE occurs. To fix this, we should change the following code in WorkbenchPage.closeAllEditors: if (deactivate) setActivePart(activationList.getActive()); to: if (deactivate) activate(activationList.getActive()); The activate method checks to see if the page is active within the window. If not, then we don't actually set focus. Note: On Nov 19, I made the change in WorkbenchPage.java to fix another problem, so no update is required to fix this.
*** Bug 5674 has been marked as a duplicate of this bug. ***
*** Bug 6449 has been marked as a duplicate of this bug. ***