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

Bug 352047

Summary: NullPointerException thrown when applying a multiple configurations after a new configuration added without applying
Product: [Tools] CDT Reporter: Tom Tan <hdwkboy>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: minor    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Tom Tan CLA 2011-07-13 22:42:28 EDT
Build Identifier: I20110613-1736

If you add a new configuration by the "Manager configurations" button but don't apply it. And right after this if you choose "Multiple Configurations" and choose the cfg you just added, then Apply, nullpointerException is thrown.

I traced the code a little and it seems if you don't apply the new added cfg, the cfg is not stored in .cproject and so CDT can not find the cfg in the "Multiple Configurations" applying, the nullpointerexception will be thrown.

The whole stack is:
java.lang.NullPointerException
at org.eclipse.cdt.ui.newui.AbstractPage.getResDesc(AbstractPage.java:920)
at org.eclipse.cdt.ui.newui.AbstractPage.performSave(AbstractPage.java:600)
at org.eclipse.cdt.ui.newui.AbstractPage.performApply(AbstractPage.java:520)
at org.eclipse.jface.preference.PreferencePage$2.widgetSelected(PreferencePage.java:281)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:158)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
...

Reproducible: Always

Steps to Reproduce:
1. Create a C/C++ project
2. Right click the project and choose Properties.
3. Choose C/C++ Build->Settings, add a new configuration from the top of the page. Don't apply!
4. Choose"Multiple Configurations..." in the configurations list, Apply! No response and you will see the exception in the console.