Program: 124904
Project: 124904
Buggy source:
/** 
 * Submits a job to run remotely on Hadoop,
 * @param monitor
 * @param jobContext
 * @param output
 * @return
 * @throws JobSubmissionException
 * @throws InterruptedException
 * @throws URISyntaxException
 * @throws OozieClientException
 */
private IStatus runRemoteJob(IProgressMonitor monitor,JobContext jobContext,StringBuffer output) throws JobSubmissionException, InterruptedException, URISyntaxException {
  String jobName=jobContext.getJobName();
  remoteJobSubmission=new RemoteJobSubmission();
  String jobIdInOozie=remoteJobSubmission.submit(jobContext);
  monitor.subTask(TOozieOutputMessages.MSG_OUTPUT_RUNNING);
  output.append(outputLogWithPrefixDate(TOozieOutputMessages.MSG_OUTPUT_RUNNING));
  updateOutputTextContents(output.toString(),jobName);
  updateAllEnabledOrNot(OozieJobProcessStatus.RUNNING,jobName);
  CorePlugin.getDefault().getPreferenceStore().putValue(TOozieCommonConstants.OOZIE_PREFIX_FOR_PREFERENCE + jobName,jobIdInOozie);
  if (monitor.isCanceled()) {
    output.append("String_Node_Str");
    updateOutputTextContents(output.toString(),jobName);
    return Status.CANCEL_STATUS;
  }
  monitor.worked(10);
  monitor.subTask("String_Node_Str");
  traceManager.putTrace(jobIdInOozie,output.toString());
  while (jobIdInOozie != null && !"String_Node_Str".equals(jobIdInOozie) && JobSubmission.Status.RUNNING == remoteJobSubmission.status(jobIdInOozie,getOozieEndPoint())) {
    Thread.sleep(1000 * 2);
  }
  checkJobStatus(jobIdInOozie,remoteJobSubmission,output,jobContext);
  updateAllEnabledOrNot(TOozieCommonUtils.convertToOozieJobProcessStatus(remoteJobSubmission.status(jobIdInOozie,getOozieEndPoint())),jobName);
  monitor.worked(50);
  return Status.OK_STATUS;
}

Fixed version (ground truth):
/** 
 * Submits a job to run remotely on Hadoop,
 * @param monitor
 * @param jobContext
 * @param output
 * @return
 * @throws JobSubmissionException
 * @throws InterruptedException
 * @throws URISyntaxException
 * @throws OozieClientException
 */
private IStatus runRemoteJob(IProgressMonitor monitor,JobContext jobContext,StringBuffer output) throws JobSubmissionException, InterruptedException, URISyntaxException {
  String jobName=jobContext.getJobName();
  remoteJobSubmission=new RemoteJobSubmission();
  String jobIdInOozie=remoteJobSubmission.submit(jobContext);
  monitor.subTask(TOozieOutputMessages.MSG_OUTPUT_RUNNING);
  output.append(outputLogWithPrefixDate(TOozieOutputMessages.MSG_OUTPUT_RUNNING));
  updateOutputTextContents(output.toString(),jobName);
  updateAllEnabledOrNot(OozieJobProcessStatus.RUNNING,jobName);
  CorePlugin.getDefault().getPreferenceStore().putValue(TOozieCommonConstants.OOZIE_PREFIX_FOR_PREFERENCE + jobName,jobIdInOozie);
  if (monitor.isCanceled()) {
    output.append("String_Node_Str");
    updateAllEnabledOrNot(OozieJobProcessStatus.CANCELED,jobName);
    updateOutputTextContents(output.toString(),jobName);
    return Status.CANCEL_STATUS;
  }
  monitor.worked(10);
  monitor.subTask("String_Node_Str");
  traceManager.putTrace(jobIdInOozie,output.toString());
  while (jobIdInOozie != null && !"String_Node_Str".equals(jobIdInOozie) && JobSubmission.Status.RUNNING == remoteJobSubmission.status(jobIdInOozie,getOozieEndPoint())) {
    Thread.sleep(1000 * 2);
  }
  checkJobStatus(jobIdInOozie,remoteJobSubmission,output,jobContext);
  updateAllEnabledOrNot(TOozieCommonUtils.convertToOozieJobProcessStatus(remoteJobSubmission.status(jobIdInOozie,getOozieEndPoint())),jobName);
  monitor.worked(50);
  return Status.OK_STATUS;
}