Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345689 - Potential NPE in ImportPackageSection#setElements()
Summary: Potential NPE in ImportPackageSection#setElements()
Status: CLOSED DUPLICATE of bug 341575
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 RC2   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 03:03 EDT by Karsten Thoms CLA
Modified: 2011-05-17 12:13 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot: Debugger (532.69 KB, image/png)
2011-05-13 03:03 EDT, Karsten Thoms CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***