Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313409 - NPE during Add Artifact to Target Platform
Summary: NPE during Add Artifact to Target Platform
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 13:42 EDT by Andrew Niefer CLA
Modified: 2010-09-03 10:24 EDT (History)
2 users (show)

See Also:
darin.eclipse: review+


Attachments
patch (2.31 KB, patch)
2010-05-18 14:07 EDT, Andrew Niefer CLA
no flags Details | Diff

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