Program: 118419
Project: 118419
Buggy source:
public void buildJob(String destinationPath,ProcessItem itemToExport,String version,String context,Map<ExportChoice,Object> exportChoiceMap,JobExportType jobExportType,IProgressMonitor monitor) throws Exception {
  IProgressMonitor pMonitor=new NullProgressMonitor();
  if (monitor != null) {
    pMonitor=monitor;
  }
  final int scale=1000;
  int total=3;
  pMonitor.beginTask(Messages.getString("String_Node_Str",jobExportType),scale * total);
  ProcessItem processItem=itemToExport;
  if (!RelationshipItemBuilder.LATEST_VERSION.equals(version) && version != null && !"String_Node_Str".equals(version) && !version.equals(processItem.getProperty().getVersion())) {
    processItem=ItemCacheManager.getProcessItem(processItem.getProperty().getId(),version);
  }
  final String label=processItem.getProperty().getLabel();
  final IBuildJobHandler buildJobHandler=BuildJobFactory.createBuildJobHandler(processItem,context,version,exportChoiceMap,jobExportType);
  ProcessUtils.setHDInsight(ProcessUtils.isDistributionExist(processItem));
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor wrMonitor) throws CoreException {
      try {
        buildJobHandler.generateItemFiles(true,new SubProgressMonitor(wrMonitor,scale));
        buildJobHandler.generateJobFiles(new SubProgressMonitor(wrMonitor,scale));
        wrMonitor.setTaskName(Messages.getString("String_Node_Str",label));
        buildJobHandler.build(new SubProgressMonitor(wrMonitor,scale));
      }
 catch (      Exception e) {
        throw new CoreException(new org.eclipse.core.runtime.Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",e));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,pMonitor);
  }
 catch (  CoreException e) {
    Throwable cause=e.getCause();
    if (cause == null) {
      throw new PersistenceException(e);
    }
    throw new PersistenceException(cause);
  }
  ProcessUtils.setHDInsight(false);
  IFile jobTargetFile=buildJobHandler.getJobTargetFile();
  if (jobTargetFile != null && jobTargetFile.exists()) {
    IPath jobZipLocation=jobTargetFile.getLocation();
    File jobZipFile=jobZipLocation.toFile();
    String jobZip=jobZipLocation.toString();
    if (needClasspathJar(exportChoiceMap)) {
      ExportJobUtil.deleteTempFiles();
      JavaJobExportReArchieveCreator creator=new JavaJobExportReArchieveCreator(jobZip,label);
      FilesUtils.unzip(jobZip,creator.getTmpFolder() + File.separator + label+ "String_Node_Str"+ version);
      creator.buildNewJar();
      ZipToFile.zipFile(creator.getTmpFolder(),jobZip);
      creator.deleteTempFiles();
    }
    Set<ProcessItem> processItems=new HashSet<ProcessItem>();
    processItems.add(processItem);
    Set<JobInfo> infos=ProcessorUtilities.getChildrenJobInfo(processItem);
    Iterator<JobInfo> infoIterator=infos.iterator();
    while (infoIterator.hasNext()) {
      processItems.add(infoIterator.next().getProcessItem());
    }
    for (    ProcessItem pi : processItems) {
      BDJobReArchieveCreator bdRecreator=new BDJobReArchieveCreator(pi,processItem);
      bdRecreator.create(jobZipFile);
    }
    File jobFileTarget=new File(destinationPath);
    if (jobFileTarget.isDirectory()) {
      jobFileTarget=new File(destinationPath,jobZipFile.getName());
    }
    FilesUtils.copyFile(jobZipFile,jobFileTarget);
  }
 else   if (jobTargetFile != null) {
    throw new Exception("String_Node_Str");
  }
  pMonitor.worked(scale);
  pMonitor.done();
}

Fixed version (ground truth):
public void buildJob(String destinationPath,ProcessItem itemToExport,String version,String context,Map<ExportChoice,Object> exportChoiceMap,JobExportType jobExportType,boolean checkCompilationError,IProgressMonitor monitor) throws Exception {
  IProgressMonitor pMonitor=new NullProgressMonitor();
  if (monitor != null) {
    pMonitor=monitor;
  }
  final int scale=1000;
  int total=3;
  pMonitor.beginTask(Messages.getString("String_Node_Str",jobExportType),scale * total);
  ProcessItem processItem=itemToExport;
  if (!RelationshipItemBuilder.LATEST_VERSION.equals(version) && version != null && !"String_Node_Str".equals(version) && !version.equals(processItem.getProperty().getVersion())) {
    processItem=ItemCacheManager.getProcessItem(processItem.getProperty().getId(),version);
  }
  final String label=processItem.getProperty().getLabel();
  final IBuildJobHandler buildJobHandler=BuildJobFactory.createBuildJobHandler(processItem,context,version,exportChoiceMap,jobExportType);
  ProcessUtils.setHDInsight(ProcessUtils.isDistributionExist(processItem));
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor wrMonitor) throws CoreException {
      try {
        buildJobHandler.generateItemFiles(true,new SubProgressMonitor(wrMonitor,scale));
        buildJobHandler.generateJobFiles(new SubProgressMonitor(wrMonitor,scale));
        wrMonitor.setTaskName(Messages.getString("String_Node_Str",label));
        buildJobHandler.build(new SubProgressMonitor(wrMonitor,scale));
      }
 catch (      Exception e) {
        throw new CoreException(new org.eclipse.core.runtime.Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",e));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,pMonitor);
  }
 catch (  CoreException e) {
    Throwable cause=e.getCause();
    if (cause == null) {
      throw new PersistenceException(e);
    }
    throw new PersistenceException(cause);
  }
  ProcessUtils.setHDInsight(false);
  IFile jobTargetFile=buildJobHandler.getJobTargetFile();
  if (jobTargetFile != null && jobTargetFile.exists()) {
    IPath jobZipLocation=jobTargetFile.getLocation();
    File jobZipFile=jobZipLocation.toFile();
    String jobZip=jobZipLocation.toString();
    if (needClasspathJar(exportChoiceMap)) {
      ExportJobUtil.deleteTempFiles();
      JavaJobExportReArchieveCreator creator=new JavaJobExportReArchieveCreator(jobZip,label);
      FilesUtils.unzip(jobZip,creator.getTmpFolder() + File.separator + label+ "String_Node_Str"+ version);
      creator.buildNewJar();
      ZipToFile.zipFile(creator.getTmpFolder(),jobZip);
      creator.deleteTempFiles();
    }
    Set<ProcessItem> processItems=new HashSet<ProcessItem>();
    processItems.add(processItem);
    Set<JobInfo> infos=ProcessorUtilities.getChildrenJobInfo(processItem);
    Iterator<JobInfo> infoIterator=infos.iterator();
    while (infoIterator.hasNext()) {
      processItems.add(infoIterator.next().getProcessItem());
    }
    for (    ProcessItem pi : processItems) {
      BDJobReArchieveCreator bdRecreator=new BDJobReArchieveCreator(pi,processItem);
      bdRecreator.create(jobZipFile);
    }
    File jobFileTarget=new File(destinationPath);
    if (jobFileTarget.isDirectory()) {
      jobFileTarget=new File(destinationPath,jobZipFile.getName());
    }
    FilesUtils.copyFile(jobZipFile,jobFileTarget);
  }
 else   if (jobTargetFile != null) {
    throw new Exception("String_Node_Str");
  }
  if (checkCompilationError) {
    CorePlugin.getDefault().getRunProcessService().checkLastGenerationHasCompilationError(false);
  }
  pMonitor.worked(scale);
  pMonitor.done();
}