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

Bug 340690

Summary: NPE when removing locations from target definition
Product: [Eclipse Project] PDE Reporter: Tim Mok <timothym>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: curtis.windatt.public
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Tim Mok CLA 2011-03-22 13:21:34 EDT
Build Identifier: Eclipse 3.7 M6 - I20110310-1119

java.lang.NullPointerException
at org.eclipse.pde.internal.core.target.P2TargetUtils.notify(P2TargetUtils.java:742)
at org.eclipse.pde.internal.core.target.P2TargetUtils.synchronize(P2TargetUtils.java:710)
at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveBundles(IUBundleContainer.java:225)
at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolve(AbstractBundleContainer.java:97)
at org.eclipse.pde.internal.core.target.TargetDefinition.resolve(TargetDefinition.java:265)
at org.eclipse.pde.internal.ui.editor.targetdefinition.TargetEditor$2.run(TargetEditor.java:461)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Reproducible: Didn't try

Steps to Reproduce:
1. Created a target definition.
2. Used Save As to make a copy.
3. Started removing locations one by one from the target definition.
4. After selecting a location and clicking Remove, I got the NPE.

It's possible that the error was caused by selecting all the locations and clicking Remove, seeing that the locations were still listed, and individually removing each location.
Comment 1 Curtis Windatt CLA 2011-03-22 14:53:58 EDT
While I couldn't reproduce locally, we need an NPE guard here.  Fixed in HEAD, see P2TargetUtils.