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 AddJavaDocStubAction_label;
	public static String AddJavaDocStubAction_description;
	public static String AddJavaDocStubAction_tooltip;
	public static String AddJavaDocStubsAction_error_dialogTitle;
	public static String AddJavaDocStubsAction_error_actionFailed;
	public static String AddJavaDocStubsAction_not_applicable;
	public static String ExternalizeStringsAction_label;
	public static String ExternalizeStringsAction_dialog_title;
	public static String ExternalizeStringsAction_dialog_message;
	public static String FindStringsToExternalizeAction_label;
	public static String FindStringsToExternalizeAction_dialog_title;
	public static String FindStringsToExternalizeAction_error_message;
	public static String FindStringsToExternalizeAction_error_cannotBeParsed;
	public static String FindStringsToExternalizeAction_foundStrings;
	public static String FindStringsToExternalizeAction_noStrings;
	public static String FindStringsToExternalizeAction_non_externalized;
	public static String FindStringsToExternalizeAction_button_label;
	public static String FindStringsToExternalizeAction_find_strings;
	public static String OpenExternalJavadocAction_label;
	public static String OpenExternalJavadocAction_description;
	public static String OpenExternalJavadocAction_tooltip;
	public static String OpenExternalJavadocAction_select_element;
	public static String OpenExternalJavadocAction_libraries_no_location;
	public static String OpenExternalJavadocAction_source_no_location;
	public static String OpenExternalJavadocAction_no_entry;
	public static String OpenExternalJavadocAction_opening_failed;
	public static String OpenExternalJavadocAction_dialog_title;
	public static String OpenExternalJavadocAction_code_resolve_failed;
	public static String SelfEncapsulateFieldAction_label;
	public static String SelfEncapsulateFieldAction_dialog_title;