Project: Eclipse_Platform_UI
Bug 165180 [Progress] org.eclipse.ui.progress.IProgressService#runInUI does not make clear expectations
Reported: 2006-11-20 12:17:14 | Status: resolved fixed

Based on the name I would expect ProgressManager.runInUI to run the given IRunnableWithProgress on the UI thread. THe java doc says: Runs the given operation in the UI thread using the given runnable context. But to my surprise the code fails to run on the UI thread. Here is the first bit of runInUI: final IJobManager manager = Platform.getJobManager(); final InvocationTargetException[] exception = new InvocationTargetException[1]; final InterruptedException[] canceled = new InterruptedException[1]; BusyIndicator.showWhile(... As you can see there is no code to consider this thread or the UI thread and certainly no effort to switch threads. When BusyIndicator.showWhile runs, it fails in a call to checkDevice() inside of display.getSystemCursor(). So either the code is seriously confused or the documentation. It certainly has me confused ;-).

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java