Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369846 - [target] NPE in load target definition when install location has errors
Summary: [target] NPE in load target definition when install location has errors
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-26 13:12 EST by Curtis Windatt CLA
Modified: 2012-03-09 11:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2012-01-26 13:12:27 EST
Somewhere we end up creating NameVersionDescriptors with null as the ID. This is related to bug 346336.

1) Create a target definition with an install location that has missing bundles (i.e. an incorrect bundles.info after updating)
2) On the content tab, hit deselect all then select all
3) Apply this target as the active target platform

java.lang.NullPointerException
	at org.eclipse.pde.core.target.NameVersionDescriptor.hashCode(NameVersionDescriptor.java:91)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.handleReload(LoadTargetDefinitionJob.java:442)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.loadPlugins(LoadTargetDefinitionJob.java:286)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:143)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Curtis Windatt CLA 2012-02-29 16:56:24 EST
Can't reproduce anymore, but I changed the constructor of NameVersionDescriptor to assert the ID as not null.  If the problem surfaces again it will give a much better stack trace then the hashCode NPE.
Comment 2 Curtis Windatt CLA 2012-03-09 11:54:22 EST
The NPE came up again.  This time I was able to track down the cause.  Typically the only time we use InvalidTargetBundles is when there is a missing bundle.  However, the ProfileBundleContainer also uses them when a file can't be found in hte Bundles.info list.

Since we only have a location for the invalid bundle, if we try to make a name/version descriptor for it, it dies.  This was happening in two places, in the target content group (we try to save missing bundles information) and during resolution (we never checked the all bundles list for error statuses).

Fixed in master.