Project: Eclipse_Platform_UI
Bug 319846 [Compatibility] Opening and closing an ant editor causes NPEs
Reported: 2010-07-14 08:54:07 | Status: resolved fixed

I had opened and closed an ant editor and clicked around in the outline. When I went back to the other ant editor I had open, clicking in the outline got: eclipse.buildId=I20100713-2016 java.fullversion=JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr8-20100401_55940 (JIT enabled, AOT enabled) J9VM - 20100401_055940 JIT - r9_20100401_15339 GC - 20100308_AA BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 -data /opt/pwebster/workspaces/e4 Error Wed Jul 14 08:45:19 EDT 2010 Internal Error org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54) at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:74) at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:90) at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:333) at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:350) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:398) 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:74) 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.Shell.setActiveControl(Shell.java:1531) at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:3401) at org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:2758) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1738) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4794) at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:3485) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4372) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8163) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1239) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2224) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3169) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:693) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:618) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:106) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:535) 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:115) 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:369) 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:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) Caused by: java.lang.NullPointerException at org.eclipse.ant.internal.ui.model.AntElementNode.getBuildFileResource(AntElementNode.java:562) at org.eclipse.ant.internal.ui.model.AntElementNode.getIFile(AntElementNode.java:551) at org.eclipse.ant.internal.ui.model.AntElementAdapterFactory.getAdapter(AntElementAdapterFactory.java:28) at org.eclipse.core.internal.adapter.AdapterFactoryProxy.getAdapter(AdapterFactoryProxy.java:80) at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:295) at org.eclipse.ant.internal.ui.model.AntElementNode.getAdapter(AntElementNode.java:569) at org.eclipse.ui.internal.ide.actions.ProjectPropertyDialogAction.getProject(ProjectPropertyDialogAction.java:117) at org.eclipse.ui.internal.ide.actions.ProjectPropertyDialogAction.selectionChanged(ProjectPropertyDialogAction.java:84) at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:135) at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$3(SelectionService.java:133) at org.eclipse.ui.internal.e4.compatibility.SelectionService$1.selectionChanged(SelectionService.java:73) at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.notifyListeners(SelectionServiceImpl.java:196) at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setPart(SelectionServiceImpl.java:153) at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:47) ... 45 more

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java