Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332765 - NPE when trying to import projects from a repo for running platform
Summary: NPE when trying to import projects from a repo for running platform
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-12-16 11:46 EST by Tomasz Zarna CLA
Modified: 2011-01-26 12:53 EST (History)
1 user (show)

See Also:


Attachments
Fix v01 (1.65 KB, patch)
2010-12-17 06:18 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2010-12-16 11:46:24 EST
I20101214-0800

Steps:
1. Import
2. Plug-ins and Fragments
3. Target definition: Running Platform
4. Import As: Projects from a repo
5. Next
=> Error Log: an error with empty message:
java.lang.NullPointerException
	at org.eclipse.pde.internal.core.PDEState.createNewTargetState(PDEState.java:153)
	at org.eclipse.pde.internal.core.PDEState.<init>(PDEState.java:102)
	at org.eclipse.pde.internal.core.PDEState.<init>(PDEState.java:92)
	at org.eclipse.pde.internal.ui.wizards.imports.PluginImportWizardFirstPage$11.run(PluginImportWizardFirstPage.java:598)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Curtis Windatt CLA 2010-12-16 12:32:13 EST
The problem is in PluginImportWizardFirstPage.  We need to create a state from the chosen target, so we resolve it and get the bundle urls.  We don't get urls for bundles that have errors (problems downloading or bad manifests, etc).  However, we create the array holding them ahead of time (resulting in null entries).

Just changing to an arraylist will avoid this.
Comment 2 Tomasz Zarna CLA 2010-12-17 06:17:30 EST
I've just noticed that my Running Platform points to a non-existing directory, so you won't be able to read any of the plug-in manifests.
Comment 3 Tomasz Zarna CLA 2010-12-17 06:18:42 EST
Created attachment 185413 [details]
Fix v01

Will this do the job?
Comment 4 Curtis Windatt CLA 2011-01-05 14:42:25 EST
Fixed in HEAD.  Thanks.
Comment 5 Curtis Windatt CLA 2011-01-26 12:53:19 EST
Verified in I20110126-0800