Project: JDT
Bug 138880 [refactor apply script] ClassCastException while appling script
Reported: 2006-04-27 06:36:10 | Status: verified fixed

what I have done: 1) change method signature (remove throws-decl) and save as script 2) manually (typing) readd throws-decl 3) apply script eclipse.buildId=N20060426-0010 java.fullversion=J2RE 1.4.2 IBM Windows 32 build cn142-20040926 (JIT enabled: jitc) BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -data C:\eclipse_N20060426\eclipse\workspace2 -os win32 -ws win32 -arch x86 -debug -consolelog Error Thu Apr 27 12:20:24 CEST 2006 Internal Error java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:350) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:851) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.getRefactoringPage(RefactoringHistoryWizard.java:885) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.getNextPage(RefactoringHistoryWizard.java:658) at org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryOverviewPage.getNextPage(RefactoringHistoryOverviewPage.java:119) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:751) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:351) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ltk.internal.ui.refactoring.actions.ApplyRefactoringScriptAction.showApplyScriptWizard(ApplyRefactoringScriptAction.java:60) at org.eclipse.jdt.internal.ui.refactoring.actions.ApplyRefactoringScriptAction.run(ApplyRefactoringScriptAction.java:48) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:254) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code)) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.ClassCastException: org.eclipse.jdt.internal.core.SourceMethod at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.initialize(ChangeSignatureRefactoring.java:2511) at org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringDescriptor.createRefactoring(JavaRefactoringDescriptor.java:330) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.createRefactoring(RefactoringHistoryWizard.java:565) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.createRefactoring(RefactoringHistoryWizard.java:585) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.access$12(RefactoringHistoryWizard.java:584) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard$8.run(RefactoringHistoryWizard.java:835) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113) Root exception: java.lang.ClassCastException: org.eclipse.jdt.internal.core.SourceMethod at org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.initialize(ChangeSignatureRefactoring.java:2511) at org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringDescriptor.createRefactoring(JavaRefactoringDescriptor.java:330) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.createRefactoring(RefactoringHistoryWizard.java:565) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.createRefactoring(RefactoringHistoryWizard.java:585) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard.access$12(RefactoringHistoryWizard.java:584) at org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryWizard$8.run(RefactoringHistoryWizard.java:835) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureRefactoring.java