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

Bug 330050

Summary: NPE when creating p2 repository with a product definition referencing non-existent icon file
Product: z_Archived Reporter: Michal Ruzicka <michal.ruza>
Component: BuckminsterAssignee: buckminster.core-inbox <buckminster.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michal Ruzicka CLA 2010-11-11 19:57:19 EST
STEPS TO REPRODUCE
1) create a feature project, let's call it com.example.exampleapp.product
2) in that feature project create a product definition file which references a non-existent icon file, something like:
   <launcher name="ExampleApp">
      <linux icon="/com.example.exampleapp.branding/icons/LinuxIcon.xpm"/>
   </launcher>
Note that the icon file ("/com.example.exampleapp.branding/icons/LinuxIcon.xpm") must not exist in the workspace.
3) invoke the site.p2 action on the com.example.exampleapp.product feature project

ACTUAL RESULT
an NPE is thrown during creation of the p2 site:
[start com.example.exampleapp.product:eclipse.feature$0.1.0.qualifier#site.p2]
: java.lang.NullPointerException

EXPECTED RESULT
a warning is displayed, stating that the product file references non-existent icon file, otherwise the site.p2 action completes successfully

ADDITIONAL INFO
it seems that the problems lies in org.eclipse.buckminster.pde.tasks.EquinoxExecutableAction.peruseIcons(IBrandingAdvice advice) lines 54-55:

54:	IResource iconRes = prj.findMember(iconPath.removeFirstSegments(1));
55:	if (iconRes.exists()) {

the org.eclipse.core.resources.IContainer.findMember(IPath path) method returns null when the path passed to it as a parameter does not designate an existing resource, in such case NPE is obviously thrown on the following line
Comment 1 Thomas Hallgren CLA 2011-03-05 06:49:52 EST
This was fixed a while ago in revision 11651.