Open reprogrammer opened 13 years ago
I encountered the following exception when I deleted a few lines of code after an extract constant refactoring.
java.lang.IllegalStateException at org.eclipse.jface.text.projection.ProjectionTextStore.internalError(ProjectionTextStore.java:85) at org.eclipse.jface.text.projection.ProjectionTextStore.get(ProjectionTextStore.java:152) at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1039) at org.eclipse.jface.text.DefaultDocumentAdapter.doGetLine(DefaultDocumentAdapter.java:150) at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:173) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:773) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:719) at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:364) at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6097) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5661) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Control.gtk_expose_event(Control.java:2783) at org.eclipse.swt.widgets.Composite.gtk_expose_event(Composite.java:701) at org.eclipse.swt.widgets.Canvas.gtk_expose_event(Canvas.java:167) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1739) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360) 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:8189) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238) at org.eclipse.swt.internal.gtk.OS._gdk_window_process_updates(Native Method) at org.eclipse.swt.internal.gtk.OS.gdk_window_process_updates(OS.java:5366) at org.eclipse.swt.widgets.Control.update(Control.java:4755) at org.eclipse.swt.widgets.Control.update(Control.java:4746) at org.eclipse.swt.widgets.Canvas.scroll(Canvas.java:267) at org.eclipse.swt.custom.StyledText.scroll(StyledText.java:7805) at org.eclipse.swt.custom.StyledText.scrollVertical(StyledText.java:7896) at org.eclipse.swt.custom.StyledText.claimBottomFreeSpace(StyledText.java:1662) at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:6230) at org.eclipse.swt.custom.StyledText$6.textChanged(StyledText.java:5636) at org.eclipse.jface.text.DefaultDocumentAdapter.fireTextChanged(DefaultDocumentAdapter.java:347) at org.eclipse.jface.text.DefaultDocumentAdapter.documentChanged(DefaultDocumentAdapter.java:291) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:760) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) at org.eclipse.jface.text.projection.ProjectionDocument.fireDocumentChanged(ProjectionDocument.java:777) at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentChanged(ProjectionDocument.java:746) at org.eclipse.jface.text.projection.ProjectionDocumentManager.fireDocumentEvent(ProjectionDocumentManager.java:123) at org.eclipse.jface.text.projection.ProjectionDocumentManager.documentChanged(ProjectionDocumentManager.java:131) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736) at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721) at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:195) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:181) at org.eclipse.ui.texteditor.TextViewerDeleteLineTarget.deleteLine(TextViewerDeleteLineTarget.java:388) at org.eclipse.ui.texteditor.DeleteLineAction.run(DeleteLineAction.java:194) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1524) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294) at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2841) at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360) 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:8189) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238) 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:2237) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) 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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1408) at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
I got the following exception when I opened two editors for a Java file and performed various edits in one of them including an extract local variable refactoring via quick assist.
java.lang.IllegalArgumentException: Index out of bounds at org.eclipse.swt.SWT.error(SWT.java:4064) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.graphics.TextLayout.getLocation(TextLayout.java:1283) at org.eclipse.swt.custom.StyledText.getPointAtOffset(StyledText.java:5456) at org.eclipse.swt.custom.StyledText.getLocationAtOffset(StyledText.java:4331) at org.eclipse.ui.texteditor.SourceViewerDecorationSupport$IBeamStrategy.draw(SourceViewerDecorationSupport.java:103) at org.eclipse.jface.text.source.AnnotationPainter.drawDecoration(AnnotationPainter.java:1424) at org.eclipse.jface.text.source.AnnotationPainter.handleDrawRequest(AnnotationPainter.java:1390) at org.eclipse.jface.text.source.AnnotationPainter.paintControl(AnnotationPainter.java:1334) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:223) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Control.gtk_expose_event(Control.java:2783) at org.eclipse.swt.widgets.Composite.gtk_expose_event(Composite.java:701) at org.eclipse.swt.widgets.Canvas.gtk_expose_event(Canvas.java:167) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1739) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360) 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:8189) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238) at org.eclipse.swt.internal.gtk.OS._gdk_window_process_updates(Native Method) at org.eclipse.swt.internal.gtk.OS.gdk_window_process_updates(OS.java:5366) at org.eclipse.swt.widgets.Control.update(Control.java:4755) at org.eclipse.swt.widgets.Control.update(Control.java:4746) at org.eclipse.swt.widgets.Canvas.scroll(Canvas.java:267) at org.eclipse.swt.custom.StyledText.scroll(StyledText.java:7805) at org.eclipse.swt.custom.StyledText.scrollText(StyledText.java:7922) at org.eclipse.swt.custom.StyledText.handleTextChanging(StyledText.java:6272) at org.eclipse.swt.custom.StyledText$6.textChanging(StyledText.java:5633) at org.eclipse.jface.text.DefaultDocumentAdapter.fireTextChanging(DefaultDocumentAdapter.java:392) at org.eclipse.jface.text.DefaultDocumentAdapter.documentAboutToBeChanged(DefaultDocumentAdapter.java:309) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:656) at org.eclipse.jface.text.projection.ProjectionDocument.delayedFireDocumentAboutToBeChanged(ProjectionDocument.java:768) at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentAboutToBeChanged(ProjectionDocument.java:727) at org.eclipse.jface.text.projection.ProjectionDocumentManager.fireDocumentEvent(ProjectionDocumentManager.java:121) at org.eclipse.jface.text.projection.ProjectionDocumentManager.documentAboutToBeChanged(ProjectionDocumentManager.java:138) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:665) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1182) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:195) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:181) at org.eclipse.text.edits.ReplaceEdit.performDocumentUpdating(ReplaceEdit.java:82) at org.eclipse.text.edits.TextEditProcessor.executeUndo(TextEditProcessor.java:223) at org.eclipse.text.edits.UndoEdit.dispatchPerformEdits(UndoEdit.java:57) at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:156) at org.eclipse.text.edits.TextEdit.apply(TextEdit.java:711) at org.eclipse.ltk.core.refactoring.UndoTextFileChange.doPerformEdits(UndoTextFileChange.java:281) at org.eclipse.ltk.core.refactoring.UndoTextFileChange.access$0(UndoTextFileChange.java:278) at org.eclipse.ltk.core.refactoring.UndoTextFileChange$1.run(UndoTextFileChange.java:243) at org.eclipse.ui.internal.editors.text.UISynchronizationContext.run(UISynchronizationContext.java:34) at org.eclipse.core.internal.filebuffers.TextFileBufferManager.execute(TextFileBufferManager.java:629) at org.eclipse.ltk.core.refactoring.UndoTextFileChange.performEdits(UndoTextFileChange.java:259) at org.eclipse.ltk.core.refactoring.UndoTextFileChange.perform(UndoTextFileChange.java:194) at org.eclipse.jdt.core.refactoring.UndoCompilationUnitChange.perform(UndoCompilationUnitChange.java:74) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter$1.run(UndoableOperation2ChangeAdapter.java:342) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1970) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1952) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter.executeChange(UndoableOperation2ChangeAdapter.java:372) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter.undo(UndoableOperation2ChangeAdapter.java:204) at org.eclipse.core.commands.operations.TriggeredOperations.undo(TriggeredOperations.java:228) at org.eclipse.core.commands.operations.DefaultOperationHistory.doUndo(DefaultOperationHistory.java:415) at org.eclipse.core.commands.operations.DefaultOperationHistory.undo(DefaultOperationHistory.java:1280) at org.eclipse.ui.operations.UndoActionHandler.runCommand(UndoActionHandler.java:78) at org.eclipse.ui.operations.OperationHistoryActionHandler$4.run(OperationHistoryActionHandler.java:311) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog.java:1) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog$2.run(TimeTriggeredProgressMonitorDialog.java:203) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.operations.TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:216) at org.eclipse.ui.operations.OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:326) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1524) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294) at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2841) at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4796) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4360) 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:8189) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1238) 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:2237) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:369) 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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1408) at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
I've some ad hoc testing to evaluate our fix for issue #232. I perform various edits and refactorings and see if any exceptions happen. As part of my ad hoc testing, I encountered various exceptions that are hard to reproduce.