Community
Participate
Working Groups
Eclipse 3.7M6 throws NPE when you click Add... to add an imported package the the manifest editor. java.lang.NullPointerException at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.setElements(ImportPackageSection.java:507) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.access$3(ImportPackageSection.java:474) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection$3.run(ImportPackageSection.java:415) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.handleAdd(ImportPackageSection.java:425) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.buttonSelected(ImportPackageSection.java:344) at org.eclipse.pde.internal.ui.editor.TableSection$PartAdapter.buttonSelected(TableSection.java:50) at org.eclipse.pde.internal.ui.parts.SharedPartWithButtons$SelectionHandler.buttonSelected(SharedPartWithButtons.java:42) at org.eclipse.pde.internal.ui.parts.SharedPartWithButtons$SelectionHandler.widgetSelected(SharedPartWithButtons.java:33) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4114) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1443) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1451) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1263) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3960) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3599) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) 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(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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)
Anything unique to reproduce it? Only way this should throw an NPE is if bundle model returns a null bundle object. However, both implementations of IBundleModel create a bundle object in their constructor.
Nothing unique is needed to reproduce it. I bring up the editor, click the Add... and I get the NPE. One thing I just noticed is that the first time I press the button, nothing appears in the Error Log. It's not until I press the button a second time that the NPE above is logged.
I reproduced this using: Version: 3.7.0 Build id: I20110329-0800 Win 7 64bit Steps: 1. new workspace 2. get org.eclipse.pde.api.tools from HEAD 3. open the manifet 4. press the add button on the Dependencies page in the Import Package section java.lang.NullPointerException at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.setElements(ImportPackageSection.java:507) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.access$3(ImportPackageSection.java:474) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection$3.run(ImportPackageSection.java:415) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.handleAdd(ImportPackageSection.java:425) at org.eclipse.pde.internal.ui.editor.plugin.ImportPackageSection.buttonSelected(ImportPackageSection.java:344) at org.eclipse.pde.internal.ui.editor.TableSection$PartAdapter.buttonSelected(TableSection.java:50) at org.eclipse.pde.internal.ui.parts.SharedPartWithButtons$SelectionHandler.buttonSelected(SharedPartWithButtons.java:42) at org.eclipse.pde.internal.ui.parts.SharedPartWithButtons$SelectionHandler.widgetSelected(SharedPartWithButtons.java:33) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) 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.Display.runDeferredEvents(Display.java:4160) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3749) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) 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(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:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Was able to reproduce. Also discovered I was looking at the wrong line in the file (there was a change committed that changed the line count). NPE comes from a completed uneeded toString() call on a possibly null string. Fixed in HEAD. See ImportPackageSection.java
*** Bug 341288 has been marked as a duplicate of this bug. ***
*** Bug 342202 has been marked as a duplicate of this bug. ***
*** Bug 342430 has been marked as a duplicate of this bug. ***
*** Bug 345689 has been marked as a duplicate of this bug. ***