Project: JDT
Bug 300805 [clean up] Invalid thread access after undo
Reported: 2010-01-26 08:14:44 | Status: verified fixed

I20100125-1800. 1. enable Save Actions to format all lines 2. paste this: public class BlowsUp { } 3. press 'Enter' after the opening brace 4. save 5. undo ==> !STACK 0 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:467) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:359) 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.jdt.internal.corext.fix.CleanUpPostSaveListener$CleanUpSaveUndo.perform(CleanUpPostSaveListener.java:164) at org.eclipse.ltk.internal.core.refactoring.UndoableOperation2ChangeAdapter$1.run(UndoableOperation2ChangeAdapter.java:321) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1985) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1967) 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.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpPostSaveListener.java