Bug 113062 [code manipulation] Generate constructor using fields throws exception when invoked in anonymous type
Build id: N20051014-0010 When invoking "generate constructor using field" in an anonymous type, the execution fails with an InvocationTargetException. As anonymous types may not have explicitly declared constructors, the source action should display an error message. java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:357) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:631) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:628) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2137) at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:1094) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1090) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:358) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:265) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:893) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2858) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1763) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1727) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:371) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:193) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1248) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createConstructorStub(StubUtility2.java:147) at org.eclipse.jdt.internal.corext.codemanipulation.AddCustomConstructorOperation.run(AddCustomConstructorOperation.java:210) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1708) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3827) at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:631) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:628) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2137) at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:1094) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1090) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:358) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:265) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:893) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2858) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1763) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1727) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:371) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Root exception: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:193) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1248) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createConstructorStub(StubUtility2.java:147) at org.eclipse.jdt.internal.corext.codemanipulation.AddCustomConstructorOperation.run(AddCustomConstructorOperation.java:210) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1708) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3827) at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291) at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:631) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:628) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2137) at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:1094) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1090) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:358) at org.eclipse.jdt.ui.actions.GenerateNewConstructorUsingFieldsAction.run(GenerateNewConstructorUsingFieldsAction.java:265) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:893) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2858) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1763) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1727) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:371) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionMessages.java
public static String OpenAction_label;
	public static String OpenAction_tooltip;
	public static String OpenAction_description;
	public static String OpenAction_declaration_label;
	public static String OpenAction_select_element;
	public static String OpenAction_error_title;
	public static String OpenAction_error_message;
	public static String OpenAction_error_messageArgs;
	public static String OpenAction_error_messageProblems;
	public static String OpenAction_error_messageBadSelection;
	public static String OpenSuperImplementationAction_label;
	public static String OpenSuperImplementationAction_tooltip;
	public static String OpenSuperImplementationAction_description;
	public static String OpenSuperImplementationAction_error_title;
	public static String OpenSuperImplementationAction_error_message;
	public static String OpenSuperImplementationAction_not_applicable;
	public static String OpenSuperImplementationAction_no_super_implementation;
	public static String OpenTypeHierarchyAction_label;
	public static String OpenTypeHierarchyAction_tooltip;
	public static String OpenTypeHierarchyAction_description;
	public static String OpenTypeHierarchyAction_dialog_title;
	public static String OpenTypeHierarchyAction_messages_title;
	public static String OpenTypeHierarchyAction_messages_no_java_element;
	public static String OpenTypeHierarchyAction_messages_no_java_resources;
	public static String OpenTypeHierarchyAction_messages_no_types;
	public static String OpenTypeHierarchyAction_messages_no_valid_java_element;
	public static String ShowInPackageViewAction_label;
	public static String ShowInPackageViewAction_description;
	public static String ShowInPackageViewAction_tooltip;
	public static String ShowInPackageViewAction_dialog_title;