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

Bug 332765

Summary: NPE when trying to import projects from a repo for running platform
Product: [Eclipse Project] PDE Reporter: Tomasz Zarna <tomasz.zarna>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 3.7Keywords: contributed
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix v01 none

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