Project: JDT
Bug 133614 [extract superclass] MTE on extract superclass preview [refactoring]
Reported: 2006-03-28 12:23:10 | Status: resolved fixed

I20060328-0010 This is hard to reproduce, it only happens sometimes, I'm not sure why. Given: package pack; public class A { public void foo() {} public void bar() {} } package pack; public class B { public void foo() {} public void bar() {} public void foobar() {} } 1. An cu A execute 'Refactor->Extract Supertype' 2. Supertype Name: 'AB' 3. Add 'B' to Types to extract a supertype from 4. Select foo() and bar() 5. Next 6. Select A#bar, A#foo, and B#foo 7. Next -> !ENTRY org.eclipse.jface 4 2 2006-03-28 19:20:18.301 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 org.eclipse.text.edits.MalformedTreeException: End position lies outside document range at org.eclipse.text.edits.TextEditProcessor.checkIntegrityDo(TextEditProcessor.java:169) at org.eclipse.text.edits.TextEdit.dispatchCheckIntegrity(TextEdit.java:704) at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:148) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange.performChanges(MultiStateTextFileChange.java:893) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange.getPreviewDocument(MultiStateTextFileChange.java:769) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange.getPreviewContent(MultiStateTextFileChange.java:739) at org.eclipse.ltk.internal.ui.refactoring.TextEditChangePreviewViewer.setInput(TextEditChangePreviewViewer.java:197) at org.eclipse.ltk.internal.ui.refactoring.AbstractChangeNode.feedInput(AbstractChangeNode.java:97) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.showPreview(PreviewWizardPage.java:532) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.access$3(PreviewWizardPage.java:517) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage$5.selectionChanged(PreviewWizardPage.java:508) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:816) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1922) at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1548) at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:384) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.setVisible(PreviewWizardPage.java:441) at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1056) at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1038) at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1028) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1026) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:757) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:351) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:652) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:132) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:145) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startExtractSupertypeRefactoring(RefactoringExecutionStarter.java:343) at org.eclipse.jdt.internal.ui.actions.ExtractSuperTypeAction.run(ExtractSuperTypeAction.java:146) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:271) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) 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:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) 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:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) 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:975) at org.eclipse.core.launcher.Main.main(Main.java:950)

Files changed in fix:
org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/CompilationUnitChangeNode.java org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/ui/refactoring/TextEditChangeNode.java