SuccessChanges

Summary

  1. Bug 489676 - Ensure that RSEInitJob is scheduled before waiting for it (details)
Commit 69465ac52526baaf2f35e51b5644e22d6896f0d9 by Simon Marchi
Bug 489676 - Ensure that RSEInitJob is scheduled before waiting for it to complete

There are two versions of RSEInitJob.waitForCompletion:

  waitForCompletion()
  waitForCompletion(int phase)

The waitForCompletion() version ensures that the job has been scheduled
before waiting for it, but not the waitForCompletion(int phase)
version.  Therefore, if the waitForCompletion(int phase) version is
called first, the calling thread can end up waiting for the completion
of a job that has never been started.

I got in this situation by disabling the auto-start of the RSE UI plugin
(in Window, Preferences, General, Startup and Shutdown).  Trying to
create a remote launch in CDT calls waitForCompletion(int phase),
therefore freezing the entire Eclipse.  When the auto-start of the RSE
UI plugin is enabled, the waitForCompletion() version is called during
the initialization of that plugin, so the problem did not appear.

The suggested fix is simple, just move the code that ensures the job has
been scheduled from waitForCompletion() to waitForCompletion(int phase),
so that the job can be scheduled by both versions (since the former is
implemented by calling the later).

Change-Id: I9f6e5f948c3dbf1be60ddf04af5adbdfcaf3a7eb
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
The file was modifiedrse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java