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

Bug 347668

Summary: [target] NPE in LoadTargetDefinitionJob#handleReload
Product: [Eclipse Project] PDE Reporter: Nicolas Bros <nicolas.bros>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 3.6.2   
Target Milestone: 3.8 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 352804    
Attachments:
Description Flags
Fix none

Description Nicolas Bros CLA 2011-05-30 11:38:59 EDT
I opened a target platform editor (org.eclipse.pde.internal.ui.editor.targetdefinition.TargetEditor).

I got:
Communication with repository at http://download.eclipse.org/eclipse/updates/3.6/R-3.6-201006080911 failed.
java.net.SocketTimeoutException: Read timed out

And then this NPE from PDE:

java.lang.NullPointerException
at org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob.handleReload(LoadTargetDefinitionJob.java:375)
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)


Eclipse Platform
Version: 3.6.2
Build id: M20110210-1200
Comment 1 Curtis Windatt CLA 2011-05-30 16:56:43 EDT
If there is a problem resolving, the getBundles call could return null.  We should handle this case better.
Comment 2 Curtis Windatt CLA 2011-07-21 16:58:10 EDT
Created attachment 200123 [details]
Fix

There are three methods that the target may return null for if there is a problem resolving.  Since we don't want to interrupt the user with the error dialog, this patch will set the results of the three methods to empty arrays.
Comment 3 Curtis Windatt CLA 2011-07-21 17:00:14 EDT
Fixed in HEAD.  See bug 352804 for backport to 3.7.1.
Comment 4 Ankur Sharma CLA 2011-08-03 09:22:12 EDT
Steps to repro not known.
Verifiying by checking the build has the new code in I20110802-2000