Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341575 - Manifest editor Add... imported package throws NPE
Summary: Manifest editor Add... imported package throws NPE
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 341288 342202 342430 345689 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-01 01:46 EDT by Bryan Hunt CLA
Modified: 2011-05-27 02:42 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Hunt CLA 2011-04-01 01:46:42 EDT
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)
Comment 1 Curtis Windatt CLA 2011-04-01 11:30:36 EDT
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.
Comment 2 Bryan Hunt CLA 2011-04-01 12:51:41 EDT
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.
Comment 3 Michael Rennie CLA 2011-04-01 15:13:20 EDT
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)
Comment 4 Curtis Windatt CLA 2011-04-01 15:31:17 EDT
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
Comment 5 Remy Suen CLA 2011-04-02 07:05:34 EDT
*** Bug 341288 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Piggott CLA 2011-04-07 14:55:37 EDT
*** Bug 342202 has been marked as a duplicate of this bug. ***
Comment 7 Curtis Windatt CLA 2011-04-11 11:18:36 EDT
*** Bug 342430 has been marked as a duplicate of this bug. ***
Comment 8 Curtis Windatt CLA 2011-05-17 12:13:54 EDT
*** Bug 345689 has been marked as a duplicate of this bug. ***