Project: SWT
Bug 255730 NPE in Tree
Reported: 2008-11-18 17:26:04 | Status: resolved fixed

I got a few of these exceptions when I ended a debug session. java.lang.NullPointerException at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:1416) at org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:250) at org.eclipse.jface.viewers.AbstractTreeViewer.getSelection(AbstractTreeViewer.java:2848) at org.eclipse.ui.internal.AbstractSelectionService.getSelection(AbstractSelectionService.java:220) at org.eclipse.ui.internal.ide.actions.BuildUtilities.findSelectedProjects(BuildUtilities.java:78) at org.eclipse.ui.actions.BuildAction.isEnabled(BuildAction.java:231) at org.eclipse.ui.actions.RetargetAction.setActionHandler(RetargetAction.java:273) at org.eclipse.ui.internal.ide.actions.RetargetActionWithDefault.setActionHandler(RetargetActionWithDefault.java:47) at org.eclipse.ui.actions.RetargetAction.partActivated(RetargetAction.java:155) at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:874) at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57) at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70) at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306) at org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:131) at org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:122) at org.eclipse.ui.internal.WWinPartService$WWinListener.partDeactivated(WWinPartService.java:50) at org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:115) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:874) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55) at org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:113) at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:242) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:300) at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57) at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3492) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:611) at org.eclipse.ui.internal.WorkbenchPage.makeActive(WorkbenchPage.java:1229) at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1209) at org.eclipse.ui.internal.WorkbenchPage.updateVisibility(WorkbenchPage.java:3635) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3575) at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:1033) at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:1017) at org.eclipse.ui.internal.WorkbenchPage$18.run(WorkbenchPage.java:3668) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3666) at org.eclipse.ui.internal.PerspectiveBarContributionItem.select(PerspectiveBarContributionItem.java:124) at org.eclipse.ui.internal.PerspectiveBarContributionItem$1.widgetSelected(PerspectiveBarContributionItem.java:93) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1097) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1121) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1106) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:933) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2927) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2660) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:370) 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:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java