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

Bug 313409

Summary: NPE during Add Artifact to Target Platform
Product: [Eclipse Project] PDE Reporter: Andrew Niefer <aniefer>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, darin.eclipse
Version: 3.6Flags: darin.eclipse: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch none

Description Andrew Niefer CLA 2010-05-18 13:42:51 EDT
On linux, With the 3.6 IBuild repository in my list of available repositories, I hit
Ctrl+Shift+Alt+A, to get the "Add Artifact to Target Platform" dialog.

I entered "org.eclipse.core.net.win32.x86" and got the NPE below.

Now, when I go edit my target platform, there is a new location "Unspecified site" with nothing under it.  Going to the Content tab shows only a "Resolving..." which never goes away, a debugger shows no worker threads doing anything.



java.lang.NullPointerException
at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveWithSlicer(IUBundleContainer.java:417)
at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveBundles(IUBundleContainer.java:197)
at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolve(AbstractBundleContainer.java:97)
at org.eclipse.pde.internal.core.target.TargetDefinition.resolve(TargetDefinition.java:239)
at org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob.handleReload(LoadTargetDefinitionJob.java:361)
at org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob.loadPlugins(LoadTargetDefinitionJob.java:284)
at org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:141)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Andrew Niefer CLA 2010-05-18 13:43:31 EDT
Removing the "Unspecified Site" from the target lets the content tab show content again.
Comment 2 Andrew Niefer CLA 2010-05-18 14:00:08 EDT
This is caused by the bundle container having fIncludeMultipleEnvironments==false
The IU being added does not match the current platform, and the slicer returns null because the input IUs don't match the platform.  The status can be seen on slicer.getStatus()

The inability to resolve the contents of the target is caused by this same NPE.
Comment 3 Andrew Niefer CLA 2010-05-18 14:07:14 EDT
Created attachment 168987 [details]
patch
Comment 4 Curtis Windatt CLA 2010-08-09 17:20:39 EDT
Patch works great, thanks Andrew!  Applied to HEAD and 3.6.1.  Darin, please review.
Comment 5 Curtis Windatt CLA 2010-08-30 16:24:38 EDT
Verified.
Comment 6 Curtis Windatt CLA 2010-09-03 10:24:50 EDT
Verified that the fix to bug 324336 didn't remove this fix in M20100902-1717.