Program: 102347
Project: 102347
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.core.resources.WorkspaceJob#runInWorkspace(org.eclipse.core.runtime.IProgressMonitor)
 */
@Override public final IStatus runInWorkspace(IProgressMonitor monitor){
  if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_START)) {
    Util.log(IStatus.INFO,NLS.bind(Messages.JobStarted,getName()));
  }
  IStatus results=null;
  long startTime=System.currentTimeMillis();
  monitor.setTaskName(getName());
  try {
    if (this.standalone) {
      Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD,monitor);
    }
    results=runImpl(monitor);
    assert(results != null);
    return results;
  }
 catch (  Exception e) {
    if (e instanceof InterruptedException) {
      return new Status(IStatus.WARNING,PLUGIN_ID,NLS.bind(Messages.JobCanceled,getName()),e);
    }
    return new Status(IStatus.ERROR,PLUGIN_ID,NLS.bind(Messages.UnexpectedErrorRunningJob,getName()),e);
  }
 finally {
    if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_DONE)) {
      Util.log(IStatus.INFO,NLS.bind(Messages.JobFinished,getName(),(results.getSeverity() != IStatus.ERROR)));
    }
    monitor.done();
    if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_DURATION)) {
      String msg;
      long milliseconds=(System.currentTimeMillis() - startTime);
      long hours=milliseconds / (1000 * 60 * 60);
      long minutes=(milliseconds % (1000 * 60 * 60)) / (1000 * 60);
      long seconds=((milliseconds % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
      if (hours > 0) {
        msg=NLS.bind(Messages.LongDurationJob,new Object[]{getName(),hours,minutes,seconds});
      }
 else       if (minutes > 0) {
        msg=NLS.bind(Messages.LessThanAnHourDurationJob,new Object[]{getName(),minutes,seconds});
      }
 else       if (seconds > 0) {
        msg=NLS.bind(Messages.LessThanAMinuteDurationJob,getName(),seconds);
      }
 else {
        msg=NLS.bind(Messages.LessThanASecondDurationJob,getName());
      }
      Util.log(IStatus.INFO,msg);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.core.resources.WorkspaceJob#runInWorkspace(org.eclipse.core.runtime.IProgressMonitor)
 */
@Override public final IStatus runInWorkspace(IProgressMonitor monitor){
  if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_START)) {
    Util.log(IStatus.INFO,NLS.bind(Messages.JobStarted,getName()));
  }
  IStatus results=null;
  long startTime=System.currentTimeMillis();
  monitor.setTaskName(getName());
  try {
    results=runImpl(monitor);
    assert(results != null);
    return results;
  }
 catch (  Exception e) {
    if (e instanceof InterruptedException) {
      return new Status(IStatus.WARNING,PLUGIN_ID,NLS.bind(Messages.JobCanceled,getName()),e);
    }
    return new Status(IStatus.ERROR,PLUGIN_ID,NLS.bind(Messages.UnexpectedErrorRunningJob,getName()),e);
  }
 finally {
    if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_DONE)) {
      Util.log(IStatus.INFO,NLS.bind(Messages.JobFinished,getName(),(results.getSeverity() != IStatus.ERROR)));
    }
    monitor.done();
    if (DqpPlugin.getInstance().isDebugOptionEnabled(DebugConstants.PREVIEW_JOB_DURATION)) {
      String msg;
      long milliseconds=(System.currentTimeMillis() - startTime);
      long hours=milliseconds / (1000 * 60 * 60);
      long minutes=(milliseconds % (1000 * 60 * 60)) / (1000 * 60);
      long seconds=((milliseconds % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
      if (hours > 0) {
        msg=NLS.bind(Messages.LongDurationJob,new Object[]{getName(),hours,minutes,seconds});
      }
 else       if (minutes > 0) {
        msg=NLS.bind(Messages.LessThanAnHourDurationJob,new Object[]{getName(),minutes,seconds});
      }
 else       if (seconds > 0) {
        msg=NLS.bind(Messages.LessThanAMinuteDurationJob,getName(),seconds);
      }
 else {
        msg=NLS.bind(Messages.LessThanASecondDurationJob,getName());
      }
      Util.log(IStatus.INFO,msg);
    }
  }
}