Project: JDT
Bug 291996 [compare] Invalid thread access from JavaMergeViewer during extracting method
Reported: 2009-10-11 10:35:40 | Status: resolved fixed

I was extracting method in the source with compilation errors. Error dialog disappeared, so I guess some shell was presented and closed after the error. org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:3952) at org.eclipse.swt.SWT.error(SWT.java:3867) at org.eclipse.swt.SWT.error(SWT.java:3838) at org.eclipse.swt.widgets.Widget.error(Widget.java:463) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355) at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7191) at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4776) at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4855) at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579) at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568) at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564) at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225) at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2806) at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3426) at org.eclipse.compare.contentmergeviewer.TextMergeViewer.invalidateTextPresentation(TextMergeViewer.java:1686) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer.handlePropertyChange(JavaMergeViewer.java:174) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer.access$4(JavaMergeViewer.java:166) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer$2.propertyChange(JavaMergeViewer.java:455) at org.eclipse.ui.texteditor.ChainedPreferenceStore.firePropertyChangeEvent(ChainedPreferenceStore.java:164) at org.eclipse.ui.texteditor.ChainedPreferenceStore.handlePropertyChangeEvent(ChainedPreferenceStore.java:431) at org.eclipse.ui.texteditor.ChainedPreferenceStore.access$0(ChainedPreferenceStore.java:408) at org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener.propertyChange(ChainedPreferenceStore.java:69) at org.eclipse.ui.preferences.ScopedPreferenceStore$3.run(ScopedPreferenceStore.java:375) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.preferences.ScopedPreferenceStore.firePropertyChangeEvent(ScopedPreferenceStore.java:372) at org.eclipse.ui.preferences.ScopedPreferenceStore$2.preferenceChange(ScopedPreferenceStore.java:194) at org.eclipse.core.internal.preferences.EclipsePreferences$2.run(EclipsePreferences.java:753) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.preferences.EclipsePreferences.firePreferenceEvent(EclipsePreferences.java:756) at org.eclipse.core.internal.preferences.EclipsePreferences.put(EclipsePreferences.java:769) at org.eclipse.ui.preferences.ScopedPreferenceStore.setValue(ScopedPreferenceStore.java:789) at org.eclipse.jface.text.templates.persistence.TemplateStore.save(TemplateStore.java:215) at org.eclipse.jdt.internal.ui.CompatibilityTemplateStore.load(CompatibilityTemplateStore.java:64) at org.eclipse.jdt.internal.ui.JavaPlugin.getCodeTemplateStore(JavaPlugin.java:899) at org.eclipse.jdt.internal.ui.viewsupport.ProjectTemplateStore.<init>(ProjectTemplateStore.java:47) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility.getCodeTemplate(StubUtility.java:1439) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility.getMethodComment(StubUtility.java:616) at org.eclipse.jdt.ui.CodeGeneration.getMethodComment(CodeGeneration.java:196) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.createNewMethod(ExtractMethodRefactoring.java:908) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.createChange(ExtractMethodRefactoring.java:486) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:3952) at org.eclipse.swt.SWT.error(SWT.java:3867) at org.eclipse.swt.SWT.error(SWT.java:3838) at org.eclipse.swt.widgets.Widget.error(Widget.java:463) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355) at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7191) at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4776) at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4855) at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579) at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568) at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564) at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:225) at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2806) at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3426) at org.eclipse.compare.contentmergeviewer.TextMergeViewer.invalidateTextPresentation(TextMergeViewer.java:1686) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer.handlePropertyChange(JavaMergeViewer.java:174) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer.access$4(JavaMergeViewer.java:166) at org.eclipse.jdt.internal.ui.compare.JavaMergeViewer$2.propertyChange(JavaMergeViewer.java:455) at org.eclipse.ui.texteditor.ChainedPreferenceStore.firePropertyChangeEvent(ChainedPreferenceStore.java:164) at org.eclipse.ui.texteditor.ChainedPreferenceStore.handlePropertyChangeEvent(ChainedPreferenceStore.java:431) at org.eclipse.ui.texteditor.ChainedPreferenceStore.access$0(ChainedPreferenceStore.java:408) at org.eclipse.ui.texteditor.ChainedPreferenceStore$PropertyChangeListener.propertyChange(ChainedPreferenceStore.java:69) at org.eclipse.ui.preferences.ScopedPreferenceStore$3.run(ScopedPreferenceStore.java:375) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.preferences.ScopedPreferenceStore.firePropertyChangeEvent(ScopedPreferenceStore.java:372) at org.eclipse.ui.preferences.ScopedPreferenceStore$2.preferenceChange(ScopedPreferenceStore.java:194) at org.eclipse.core.internal.preferences.EclipsePreferences$2.run(EclipsePreferences.java:753) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.preferences.EclipsePreferences.firePreferenceEvent(EclipsePreferences.java:756) at org.eclipse.core.internal.preferences.EclipsePreferences.put(EclipsePreferences.java:769) at org.eclipse.ui.preferences.ScopedPreferenceStore.setValue(ScopedPreferenceStore.java:789) at org.eclipse.jface.text.templates.persistence.TemplateStore.save(TemplateStore.java:215) at org.eclipse.jdt.internal.ui.CompatibilityTemplateStore.load(CompatibilityTemplateStore.java:64) at org.eclipse.jdt.internal.ui.JavaPlugin.getCodeTemplateStore(JavaPlugin.java:899) at org.eclipse.jdt.internal.ui.viewsupport.ProjectTemplateStore.<init>(ProjectTemplateStore.java:47) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility.getCodeTemplate(StubUtility.java:1439) at org.eclipse.jdt.internal.corext.codemanipulation.StubUtility.getMethodComment(StubUtility.java:616) at org.eclipse.jdt.ui.CodeGeneration.getMethodComment(CodeGeneration.java:196) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.createNewMethod(ExtractMethodRefactoring.java:908) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring.createChange(ExtractMethodRefactoring.java:486) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124) at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java