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

Bug 360721

Summary: InvocationTargetException in New Class Wizard
Product: [Tools] CDT Reporter: Pieter Jordaan <pieterwjordaanpc>
Component: cdt-refactoringAssignee: Sergey Prigogin <eclipse.sprigogin>
Status: RESOLVED FIXED QA Contact: Sergey Prigogin <eclipse.sprigogin>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Pieter Jordaan CLA 2011-10-12 15:44:12 EDT
Adding a new class through the file menu using the wizard causes an error and the class is not created (an empty header file with the class name however is created).

What steps will reproduce the problem?
1. Create a new c++ project
2. Add new class using the wizard
3. Click apply


-- Error Details --
Date: Wed Oct 12 21:31:41 SAST 2011
Message: Error
Severity: Error
Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.linuxtools.product)
Plugin: org.eclipse.cdt.ui
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_ZA
Framework arguments:  -product org.eclipse.epp.package.linuxtools.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.linuxtools.product

Exception Stack Trace:
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:477)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
	at org.eclipse.cdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:107)
	at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.performFinish(NewClassCreationWizard.java:70)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	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:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction.run(WizardShortcutAction.java:98)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
	at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructClassDefinition(NewClassCodeGenerator.java:471)
	at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructHeaderFileContent(NewClassCodeGenerator.java:348)
	at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:211)
	at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:2116)
	at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:2056)
	at org.eclipse.cdt.internal.ui.wizards.NewClassCreationWizard.finishPage(NewClassCreationWizard.java:60)
	at org.eclipse.cdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:100)
	at org.eclipse.cdt.internal.core.model.BatchOperation.executeOperation(BatchOperation.java:36)
	at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:339)
	at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:602)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1234)
	at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:84)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	... 44 more
Comment 1 Sergey Prigogin CLA 2011-12-14 15:52:40 EST
This was fixed in CDT 8.0.1. Pieter, please verify. Thanks.