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 RemoveFromClasspathAction_Problems_occurred;
	public static String AddDelegateMethodsAction_error_title;
	public static String AddDelegateMethodsAction_error_actionfailed;
	public static String AddDelegateMethodsAction_label;
	public static String AddDelegateMethodsAction_description;
	public static String AddDelegateMethodsAction_tooltip;
	public static String AddDelegateMethodsAction_not_applicable;
	public static String AddDelegateMethodsAction_annotation_not_applicable;
	public static String AddDelegateMethodsAction_interface_not_applicable;
	public static String AddDelegateMethodsAction_duplicate_methods;
	public static String AddDelegateMethodsAction_title;
	public static String AddDelegateMethodsAction_message;
	public static String AddDelegateMethodsAction_selectioninfo_more;
	public static String AddDelegateMethodsOperation_monitor_message;
	public static String ToggleLinkingAction_label;
	public static String ToggleLinkingAction_tooltip;
	public static String ToggleLinkingAction_description;
	public static String ConfigureContainerAction_error_title;
	public static String ConfigureContainerAction_error_creationfailed_message;
	public static String ConfigureContainerAction_error_applyingfailed_message;
	public static String FindExceptionOccurrences_text;
	public static String FindExceptionOccurrences_toolTip;
	public static String FindImplementOccurrencesAction_text;
	public static String FindImplementOccurrencesAction_toolTip;
	public static String QuickMenuAction_menuTextWithShortcut;
	static {
		NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
	}
	public static String OpenTypeHierarchyAction_messages_unknown_import_decl;
}