Project: JDT
Bug 81131 IllegalArgumentException in SimpleName.setIdentifier when moving vararg method
Reported: 2004-12-15 08:42:44 | Status: verified fixed

M4 test pass (I20041214-2000-gtk) 1. have the type below 2. move 'method' to 'Inner' -> get the exception below --------- Test.java -------- package com.example.m4testing; public class Test { static class Inner { private Object fObject; public boolean check() { return true; } public Object get() { return fObject; } public void set(Object object) { fObject= object; } } /** * Execute da stuff. * * @param inner the target */ void method(Inner inner, int size, int... numbers) { if (inner.check()) { inner.set(inner.get()); } } boolean localCheck() { return true; } public void caller() { Inner inner= new Inner(); method(inner, 4, 3, 2, 1, 0); } } --------- Exception -------- !ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2004-12-15 14:41:04.125 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:303) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:282) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:539) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:605) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:406) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:396) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:543) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:996) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2698) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2397) at org.eclipse.jface.window.Window.runEventLoop(Window.java:718) at org.eclipse.jface.window.Window.open(Window.java:696) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:125) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:138) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.ui.refactoring.actions.MoveInstanceMethodAction.run(MoveInstanceMethodAction.java:158) at org.eclipse.jdt.internal.ui.refactoring.actions.MoveInstanceMethodAction.run(MoveInstanceMethodAction.java:172) at org.eclipse.jdt.internal.ui.refactoring.actions.MoveInstanceMethodAction.run(MoveInstanceMethodAction.java:146) at org.eclipse.jdt.ui.actions.MoveAction.tryMoveInstanceMethod(MoveAction.java:221) at org.eclipse.jdt.ui.actions.MoveAction.run(MoveAction.java:148) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:216) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:188) at org.eclipse.jface.action.Action.runWithEvent(Action.java:989) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:188) at org.eclipse.ui.internal.commands.Command.execute(Command.java:130) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:445) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:724) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:767) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:536) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:479) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:221) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1067) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:995) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1020) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1005) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1032) at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:596) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1886) at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:527) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1332) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3241) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:4633) at org.eclipse.swt.widgets.Display.eventProc(Display.java:907) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1095) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2395) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1569) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:285) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:710) at org.eclipse.core.launcher.Main.main(Main.java:694) Caused by: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:187) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1214) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor$1.getArgumentNode(MoveInstanceMethodProcessor.java:1728) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createArgumentList(MoveInstanceMethodProcessor.java:1486) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createMethodArguments(MoveInstanceMethodProcessor.java:1716) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createMethodCopy(MoveInstanceMethodProcessor.java:1921) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createChangeManager(MoveInstanceMethodProcessor.java:1553) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.checkFinalConditions(MoveInstanceMethodProcessor.java:1119) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:153) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:188) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1674) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105) Root exception: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:187) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1214) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor$1.getArgumentNode(MoveInstanceMethodProcessor.java:1728) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createArgumentList(MoveInstanceMethodProcessor.java:1486) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createMethodArguments(MoveInstanceMethodProcessor.java:1716) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createMethodCopy(MoveInstanceMethodProcessor.java:1921) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createChangeManager(MoveInstanceMethodProcessor.java:1553) at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.checkFinalConditions(MoveInstanceMethodProcessor.java:1119)

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