Project: JDT
Bug 183857 [package explorer] NPE from PackageExplorerPart for unknown editor input
Reported: 2007-04-24 16:11:04 | Status: resolved fixed

When opening a compare editor, I get an NPE from PackageExplorerPart: java.lang.NullPointerException at org.eclipse.jdt.ui.JavaUI.getEditorInputJavaElement(JavaUI.java:731) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.editorActivated(PackageExplorerPart.java:1112) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$1.partActivated(PackageExplorerPart.java:229) at org.eclipse.ui.internal.PartListenerList2$1.run(PartListenerList2.java:68) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartActivated(PartListenerList2.java:66) at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:77) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:171) at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:56) at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3289) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:601) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2670) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2592) at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:2584) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2569) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2564) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2548) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2531) at org.eclipse.compare.internal.CompareUIPlugin$1.run(CompareUIPlugin.java:454) at org.eclipse.compare.internal.CompareUIPlugin.syncExec(CompareUIPlugin.java:1171) at org.eclipse.compare.internal.CompareUIPlugin.internalOpenEditor(CompareUIPlugin.java:465) at org.eclipse.compare.internal.CompareUIPlugin.openEditorInBackground(CompareUIPlugin.java:436) at org.eclipse.compare.internal.CompareUIPlugin.openCompareEditor(CompareUIPlugin.java:426) at org.eclipse.compare.CompareUI.openCompareEditorOnPage(CompareUI.java:135) at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.openCompareEditor(OpenInCompareAction.java:210) at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.openCompareEditor(OpenInCompareAction.java:169) at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.openCompareEditor(OpenInCompareAction.java:113) at org.eclipse.team.internal.ui.synchronize.actions.OpenInCompareAction.run(OpenInCompareAction.java:65) at org.eclipse.team.ui.synchronize.ModelSynchronizeParticipantActionGroup$1.run(ModelSynchronizeParticipantActionGroup.java:103) at org.eclipse.team.internal.ui.synchronize.StructuredViewerAdvisor.handleOpen(StructuredViewerAdvisor.java:171) at org.eclipse.team.internal.ui.synchronize.StructuredViewerAdvisor.access$0(StructuredViewerAdvisor.java:167) at org.eclipse.team.internal.ui.synchronize.StructuredViewerAdvisor$3.open(StructuredViewerAdvisor.java:131) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:45) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:187) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079) at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:353) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1178) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:101) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:480) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:419) at org.eclipse.equinox.launcher.Main.run(Main.java:1145) at org.eclipse.equinox.launcher.Main.main(Main.java:1120)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java