Project: JDT
Bug 284769 [Extract Superclass] IOOBE extracting superclass
Reported: 2009-07-27 11:27:09 | Status: verified fixed

Build ID: M20090211-1700 Steps To Reproduce: 1. Run 'Refactor > Extract Superclass' on the included class. 2. Select target, defaultTarget, enroll(), cancel() as elements to pull up. Name the new class MultiplexingStream 3. Hit next until the IOOBE is thrown. Marking as 'major' since I can't refactor. More information: eclipse.buildId=I20090618-1753 java.fullversion=J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223ifx-20090422 (JIT enabled) J9VM - 20090421_34076_lHdSMr JIT - 20081112_1511ifx6_r8 GC - 200811_07 BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA Command-line arguments: -os linux -ws gtk -arch x86 -console Error Mon Jul 27 11:16:01 EDT 2009 Internal Error java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:934) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:584) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:423) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:75) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:115) at org.eclipse.jdt.internal.ui.refactoring.PullUpMethodPage.getNextPage(PullUpMethodPage.java:446) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:813) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:144) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:156) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:37) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startExtractSupertypeRefactoring(RefactoringExecutionStarter.java:302) at org.eclipse.jdt.internal.ui.actions.ExtractSuperClassAction.run(ExtractSuperClassAction.java:141) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1 at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsModel.createMethodParameterVariable(SuperTypeConstraintsModel.java:386) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:405) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:243) at org.eclipse.jdt.core.dom.ClassInstanceCreation.accept0(ClassInstanceCreation.java:337) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2525) at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:225) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.FieldDeclaration.accept0(FieldDeclaration.java:287) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:214) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.performFirstPass(SuperTypeRefactoringProcessor.java:734) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor$3.acceptAST(SuperTypeRefactoringProcessor.java:1210) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:721) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:474) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:736) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.solveSuperTypeConstraints(SuperTypeRefactoringProcessor.java:1206) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.access$0(PullUpRefactoringProcessor.java:1) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor$1.acceptAST(PullUpRefactoringProcessor.java:1899) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:721) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:474) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:736) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.rewriteTypeOccurrences(PullUpRefactoringProcessor.java:1881) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.createChangeManager(PullUpRefactoringProcessor.java:1225) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.checkFinalConditions(PullUpRefactoringProcessor.java:746) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractSupertypeProcessor.checkFinalConditions(ExtractSupertypeProcessor.java:237) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:225) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Root exception: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1 at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsModel.createMethodParameterVariable(SuperTypeConstraintsModel.java:386) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:405) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:243) at org.eclipse.jdt.core.dom.ClassInstanceCreation.accept0(ClassInstanceCreation.java:337) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2525) at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:225) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.FieldDeclaration.accept0(FieldDeclaration.java:287) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:214) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.performFirstPass(SuperTypeRefactoringProcessor.java:734) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor$3.acceptAST(SuperTypeRefactoringProcessor.java:1210) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:721) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:474) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:736) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.solveSuperTypeConstraints(SuperTypeRefactoringProcessor.java:1206) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.access$0(PullUpRefactoringProcessor.java:1) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor$1.acceptAST(PullUpRefactoringProcessor.java:1899) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:721) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:474) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:736) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.rewriteTypeOccurrences(PullUpRefactoringProcessor.java:1881) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.createChangeManager(PullUpRefactoringProcessor.java:1225) at org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.checkFinalConditions(PullUpRefactoringProcessor.java:746) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractSupertypeProcessor.checkFinalConditions(ExtractSupertypeProcessor.java:237) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:225) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

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