Project: JDT
Bug 45332 Method inline fails [refactoring]
Reported: 2003-10-21 16:44:04 | Status: resolved fixed

Problem was also present in R2.1. Tried to inline all invocations of a simple method: public static void assertTrue(boolean invariant) { assert invariant; } !SESSION Oct 21, 2003 13:33:31.629 --------------------------------------------- java.version=1.4.1_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 -data /local/home/nickell/eclipse -install file:/opt/eclipse/ !ENTRY org.eclipse.jdt.ui 4 10001 Oct 21, 2003 13:33:31.630 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetExceptionjava.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:313) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:271) at org.eclipse.jdt.internal.ui.refactoring.PerformRefactoringUtil.performRefactoring(PerformRefactoringUtil.java:53) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:409) at org.eclipse.jdt.internal.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:119) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:472) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:395) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:263) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:430) 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:962) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1815) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1595) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:56) at org.eclipse.jdt.internal.ui.refactoring.actions.InlineMethodAction.activate(InlineMethodAction.java:128) at org.eclipse.jdt.internal.ui.refactoring.actions.InlineMethodAction.run(InlineMethodAction.java:121) at org.eclipse.jdt.internal.ui.refactoring.actions.InlineMethodAction.run(InlineMethodAction.java:82) at org.eclipse.jdt.ui.actions.InlineAction.tryInlineMethod(InlineAction.java:132) at org.eclipse.jdt.ui.actions.InlineAction.run(InlineAction.java:109) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:196) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:203) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:212) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:541) at org.eclipse.jface.action.ActionContributionItem.access$4(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:466) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1815) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1595) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2347) at org.eclipse.ui.internal.Workbench.run(Workbench.java:2330) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:299) at org.eclipse.core.launcher.Main.run(Main.java:765) at org.eclipse.core.launcher.Main.main(Main.java:599) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.eclipse.jdt.internal.corext.refactoring.code.flow.LocalFlowInfo.<init>(LocalFlowInfo.java:24) at org.eclipse.jdt.internal.corext.refactoring.code.flow.FlowAnalyzer.endVisit(FlowAnalyzer.java:666) at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:85) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:1400) at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:91) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:1400) at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:209) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:1400) at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:81) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:1423) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:81) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:1400) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:178) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:1353) at org.eclipse.jdt.internal.corext.refactoring.code.flow.InputFlowAnalyzer.perform(InputFlowAnalyzer.java:111) at org.eclipse.jdt.internal.corext.refactoring.code.CallInliner.flowAnalysis(CallInliner.java:390) at org.eclipse.jdt.internal.corext.refactoring.code.CallInliner.initialize(CallInliner.java:269) at org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring.checkInput(InlineMethodRefactoring.java:211) at org.eclipse.jdt.internal.ui.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:65) at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:100) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:138) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302) ... 45 more

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/LocalVariableIndex.java