Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345689

Summary: Potential NPE in ImportPackageSection#setElements()
Product: [Eclipse Project] PDE Reporter: Karsten Thoms <karsten.thoms>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 3.7   
Target Milestone: 3.7 RC2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Screenshot: Debugger none

Description Karsten Thoms CLA 2011-05-13 03:03:06 EDT
Created attachment 195559 [details]
Screenshot: Debugger

I am hitting a NPE in the mentioned method in this line:

   NameVersionDescriptor nameVersion = new NameVersionDescriptor(pkgs[j].getName(), pkgs[j].getVersion().toString(), NameVersionDescriptor.TYPE_PACKAGE);

The only thing that might cause the NPE here is when pkgs[j].getVersion() returns null, 

This happened when I click on the "Add" button for Imported Packages. The list is at the moment empty. The Manifest content is:
===========================
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: lwc11-test
Bundle-SymbolicName: lwc11-test
Bundle-Version: 1.0.0.qualifier
Export-Package: entities,
 example
Require-Bundle: org.eclipse.emf.mwe2.launch;bundle-version="2.0.0",
 org.eclipse.xtext.example.domainmodel.m2m;bundle-version="1.0.0"
===========================

So the exported packages have no version specified, and I think the code must expect this here.
Comment 1 Curtis Windatt CLA 2011-05-13 10:07:40 EDT
This should be investigated for 3.7
Comment 2 Curtis Windatt CLA 2011-05-17 12:13:54 EDT
Already fixed in M7.  In the future, please put the stack trace in a bug comment.  It makes it easier to find duplicates.

*** This bug has been marked as a duplicate of bug 341575 ***