Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349247 - [wizard] invoking the new team wizard from the PDE editor throws NPE
Summary: [wizard] invoking the new team wizard from the PDE editor throws NPE
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P2 critical (vote)
Target Milestone: 2.0   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 17:46 EDT by Stephan Herrmann CLA
Modified: 2012-01-29 17:26 EST (History)
0 users

See Also:


Attachments
trivial fix (837 bytes, patch)
2011-06-13 18:01 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-06-13 17:46:50 EDT
This is a regression introduced by bug 346799:

When the new team wizard is invoked without a current selection
it throws the following NPE:

java.lang.NullPointerException
        at org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage.getInitialJavaElement(NewTypeWizardPage.java:789)
        at org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage.init(NewTypeWizardPage.java:781)
        at org.eclipse.objectteams.otdt.internal.pde.ui.ExtensionEditorAdaptor$__OT__JavaAttributeWizard.addNewTeamWizardPage(ExtensionEditorAdaptor.java:199)
        at org.eclipse.objectteams.otdt.internal.pde.ui.ExtensionEditorAdaptor._OT$JavaAttributeWizard$addNewTeamWizardPage$addPages(ExtensionEditorAdaptor.java:189)
        at org.eclipse.pde.internal.ui.editor.plugin.JavaAttributeWizard._OT$addPages$chain(JavaAttributeWizard.java)
        at org.eclipse.pde.internal.ui.editor.plugin.JavaAttributeWizard.addPages(JavaAttributeWizard.java)
        at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:605)

This makes it impossible to use the link in the PDE editor for creating
a team that has been referenced in an aspectBinding but doesn't exist.
Comment 1 Stephan Herrmann CLA 2011-06-13 17:54:40 EDT
For reproducing note that the workspace must have > 1 projects,
otherwise the single project will be picked as the current selection.
Comment 2 Stephan Herrmann CLA 2011-06-13 18:01:04 EDT
Created attachment 197932 [details]
trivial fix

Just checking for null fixes this issue indeed.
Comment 3 Stephan Herrmann CLA 2011-06-13 18:39:44 EDT
.
Comment 4 Stephan Herrmann CLA 2011-06-14 18:24:47 EDT
Patch has been committed, build was contributed for RC5.
Comment 5 Stephan Herrmann CLA 2012-01-29 17:26:29 EST
Verified using build 201201281118.