Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328068 - Creation of element failed error when creating new C++ class
Summary: Creation of element failed error when creating new C++ class
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 6.0.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.0.2   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-18 15:11 EDT by tleyda CLA
Modified: 2010-10-22 05:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tleyda CLA 2010-10-18 15:11:27 EDT
Build Identifier: V

When trying to create a C++ class, I get an error that says "Creation of element failed.  See error log."  The header file with the class stub is created OK, but the source file isn't.  It just creates a blank source file.

Exception Stack Trace:
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:944)
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:752)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
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:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
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:368)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.lang.NullPointerException
at org.eclipse.cdt.internal.corext.util.Strings.containsOnlyWhitespaces(Strings.java:94)
at org.eclipse.cdt.internal.corext.codemanipulation.StubUtility.getMethodBodyContent(StubUtility.java:178)
at org.eclipse.cdt.internal.corext.codemanipulation.StubUtility.getConstructorBodyContent(StubUtility.java:154)
at org.eclipse.cdt.ui.CodeGeneration.getConstructorBodyContent(CodeGeneration.java:124)
at org.eclipse.cdt.internal.ui.wizards.classwizard.ConstructorMethodStub.createMethodImplementation(ConstructorMethodStub.java:65)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addMethodBodies(NewClassCodeGenerator.java:901)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructSourceFileContent(NewClassCodeGenerator.java:800)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:218)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1921)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1867)
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:35)
at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:338)
at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:603)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1234)
at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Root exception:
java.lang.NullPointerException
at org.eclipse.cdt.internal.corext.util.Strings.containsOnlyWhitespaces(Strings.java:94)
at org.eclipse.cdt.internal.corext.codemanipulation.StubUtility.getMethodBodyContent(StubUtility.java:178)
at org.eclipse.cdt.internal.corext.codemanipulation.StubUtility.getConstructorBodyContent(StubUtility.java:154)
at org.eclipse.cdt.ui.CodeGeneration.getConstructorBodyContent(CodeGeneration.java:124)
at org.eclipse.cdt.internal.ui.wizards.classwizard.ConstructorMethodStub.createMethodImplementation(ConstructorMethodStub.java:65)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.addMethodBodies(NewClassCodeGenerator.java:901)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.constructSourceFileContent(NewClassCodeGenerator.java:800)
at org.eclipse.cdt.internal.ui.wizards.classwizard.NewClassCodeGenerator.createClass(NewClassCodeGenerator.java:218)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1921)
at org.eclipse.cdt.ui.wizards.NewClassCreationWizardPage.createClass(NewClassCreationWizardPage.java:1867)
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:35)
at org.eclipse.cdt.internal.core.model.CModelOperation.execute(CModelOperation.java:338)
at org.eclipse.cdt.internal.core.model.CModelOperation.run(CModelOperation.java:603)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at org.eclipse.cdt.core.model.CoreModel.run(CoreModel.java:1234)
at org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:63)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Session Data:
eclipse.buildId=M20100211-1343
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86

Reproducible: Always
Comment 1 tleyda CLA 2010-10-18 15:12:47 EDT
Messed up the build ID.  It should be: Version 3.5.2. Build M20100211-1343.
Comment 2 Anton Leherbauer CLA 2010-10-22 04:26:41 EDT
Fixed in HEAD and 7.0.2.