Project: JDT
Bug 300536 [quick fix] Invalid thread access while undoing quick fix
Reported: 2010-01-22 14:01:04 | Status: verified fixed

[I20100122-0800] I quick-fixed a dead code error and then used undo to see previous state. Got this error: org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.widgets.Widget.error(Widget.java:664) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:491) at org.eclipse.swt.custom.StyledText.getLinePixel(StyledText.java:4167) at org.eclipse.swt.custom.StyledText.handleTextChanging(StyledText.java:6241) at org.eclipse.swt.custom.StyledText$6.textChanging(StyledText.java:5611) 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:641) at org.eclipse.jface.text.projection.ProjectionDocument.delayedFireDocumentAboutToBeChanged(ProjectionDocument.java:769) at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentAboutToBeChanged(ProjectionDocument.java:728) 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:645) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1148) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:195) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1176) 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.perform(UndoTextFileChange.java:195) at org.eclipse.jdt.core.refactoring.UndoCompilationUnitChange.perform(UndoCompilationUnitChange.java:74) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter$1.run(UndoableOperation2ChangeAdapter.java:321) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1859) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1841) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter.executeChange(UndoableOperation2ChangeAdapter.java:351) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter.undo(UndoableOperation2ChangeAdapter.java:183) 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$ModalContextThread.run(ModalContext.java:121)

Files changed in fix:
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/UndoTextFileChange.java