Project: JDT
Bug 89523 [refactoring] AFE in 'Extract interface'
Reported: 2005-03-30 07:53:37 | Status: verified fixed

I20050329-2000 - Have this type: class SubGeneric<E extends Number> { private E field2; Number number; public final E getField2() { return field2; } public final Number getNumber() { return number; } } - Note that there aren't any references to this type (but that does not matter, the exception happens anyway) - Extract Interface - select both methods - choose to change references to SubGeneric with interface where possible - press 'preview' Get this: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:327) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:282) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:570) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:413) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:74) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:114) at org.eclipse.jdt.internal.ui.refactoring.ExtractInterfaceWizard$ExtractInterfaceInputPage.getNextPage(ExtractInterfaceWizard.java:324) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.previewPressed(RefactoringWizardDialog2.java:436) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.access$3(RefactoringWizardDialog2.java:434) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2$1.widgetSelected(RefactoringWizardDialog2.java:570) 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:1012) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2778) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2472) at org.eclipse.jface.window.Window.runEventLoop(Window.java:803) at org.eclipse.jface.window.Window.open(Window.java:781) 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.ui.actions.ExtractInterfaceAction.startRefactoring(ExtractInterfaceAction.java:161) at org.eclipse.jdt.ui.actions.ExtractInterfaceAction.run(ExtractInterfaceAction.java:145) 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:996) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:216) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:225) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) 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:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2778) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2472) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151) 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.invokeFramework(Main.java:268) at org.eclipse.core.launcher.Main.basicRun(Main.java:260) at org.eclipse.core.launcher.Main.run(Main.java:887) at org.eclipse.core.launcher.Main.main(Main.java:871) Caused by: org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:139) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:124) at org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ImmutableTypeVariable2.<init>(ImmutableTypeVariable2.java:26) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsModel.createMethodParameterVariable(SuperTypeConstraintsModel.java:371) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:406) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:518) at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:246) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497) at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:143) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2497) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2520) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:299) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2450) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.performFirstPass(SuperTypeRefactoringProcessor.java:312) at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.solveSuperTypeConstraints(SuperTypeRefactoringProcessor.java:622) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.access$2(ExtractInterfaceProcessor.java:1) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor$2.acceptAST(ExtractInterfaceProcessor.java:1135) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:658) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:441) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:646) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.rewriteTypeOccurrences(ExtractInterfaceProcessor.java:1117) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.createChangeManager(ExtractInterfaceProcessor.java:357) at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.checkFinalConditions(ExtractInterfaceProcessor.java:228) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:165) 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.core.internal.resources.Workspace.run(Workspace.java:1714) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86) 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/typeconstraints2/ImmutableTypeVariable2.java