Bug 219250

Summary: NPE opening non-feature.xml feature file
Product: [Eclipse Project] PDE Reporter: Jeff McAffer <jeffmcaffer>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk
Version: 3.4Keywords: bugday
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Jeff McAffer CLA 2008-02-17 09:12:52 EST
in 0212

- create a feature using the normal process.
- rename the feature.xml to features.xml (not sure the name really matters but this is what I did)
- drag and drop the file into the editor area
- observe the following NPE

java.lang.NullPointerException
	at org.eclipse.pde.internal.ui.editor.feature.FeatureEditor.createResourceContexts(FeatureEditor.java:93)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditor.createInputContexts(PDEFormEditor.java:196)
	at org.eclipse.pde.internal.ui.editor.PDEFormEditor.createPages(PDEFormEditor.java:248)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:304)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:300)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)
	at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
	at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
	at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
	at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
	at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
	at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
	at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
Comment 1 Chris Aniszczyk CLA 2008-02-17 18:15:01 EST
omg Jeff... what are you doing >:)

Why rename the feature.xml? PDE doesn't support this scenario...

We can guard against the NPE here and the fix for that is easy so I'm going to tag as bugday.
Comment 2 Jeff McAffer CLA 2008-02-18 00:05:24 EST
If you really want a shock, see my post in pde-dev.  Connect that with this and see where you get :-)
Comment 3 Chris Aniszczyk CLA 2008-02-18 09:56:35 EST
Add an NPE guard to catch this esoteric case :)
Comment 4 Chris Aniszczyk CLA 2008-02-18 09:56:55 EST
done
Comment 5 Chris Aniszczyk CLA 2008-02-18 09:56:58 EST
Created attachment 89983 [details]
mylyn/context/zip