Program: 121728
Project: 121728
Buggy source:
private boolean exportJobScript(List<RepositoryNode> nodes,String version,String bundleVersion,IProgressMonitor monitor){
  manager.setJobVersion(version);
  manager.setBundleVersion(bundleVersion);
  List<ExportFileResource> processes=getProcesses(nodes,"String_Node_Str");
  boolean isNotFirstTime=directoryName != null;
  if (isNotFirstTime && processes != null) {
    for (    ExportFileResource process : processes) {
      process.setDirectoryName(directoryName);
    }
  }
  try {
    ProxyRepositoryFactory.getInstance().initialize();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  ItemCacheManager.clearCache();
  if (!isMultiNodes()) {
    for (    ExportFileResource process : processes) {
      process.removeAllMap();
      ProcessItem processItem=(ProcessItem)process.getItem();
      if (!processItem.getProperty().getVersion().equals(version)) {
        process.setProcess(ItemCacheManager.getProcessItem(processItem.getProperty().getId(),version));
      }
    }
  }
  manager.setProgressMonitor(monitor);
  List<ExportFileResource> resourcesToExport=null;
  try {
    resourcesToExport=manager.getExportResources(processes.toArray(new ExportFileResource[]{}));
    IStructuredSelection selection=new StructuredSelection(nodes);
    boolean hasErrors=CorePlugin.getDefault().getRunProcessService().checkExportProcess(selection,true);
    if (hasErrors) {
      manager.deleteTempFiles();
      return false;
    }
  }
 catch (  ProcessorException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
  if (isMultiNodes()) {
    manager.setTopFolder(resourcesToExport);
  }
  doArchiveExport(monitor,resourcesToExport);
  clean();
  ProcessorUtilities.resetExportConfig();
  boolean generated=generatedCodes(version,monitor,processes);
  if (!generated) {
    return false;
  }
  monitor.subTask(Messages.getString("String_Node_Str",type));
  boolean addClasspathJar=true;
  IDesignerCoreService designerCoreService=CoreRuntimePlugin.getInstance().getDesignerCoreService();
  if (designerCoreService != null) {
    addClasspathJar=designerCoreService.getDesignerCorePreferenceStore().getBoolean(IRepositoryPrefConstants.ADD_CLASSPATH_JAR);
  }
  if (addClasspathJar) {
    reBuildJobZipFile(processes);
  }
 else {
    String zipFile=getTempDestinationValue();
    String destinationZipFile=manager.getDestinationPath();
    FileCopyUtils.copy(zipFile,destinationZipFile);
  }
  return true;
}

Fixed version (ground truth):
private boolean exportJobScript(List<RepositoryNode> nodes,String version,String bundleVersion,IProgressMonitor monitor){
  manager.setJobVersion(version);
  manager.setBundleVersion(bundleVersion);
  List<ExportFileResource> processes=getProcesses(nodes,"String_Node_Str");
  boolean isNotFirstTime=directoryName != null;
  if (isNotFirstTime && processes != null) {
    for (    ExportFileResource process : processes) {
      process.setDirectoryName(directoryName);
    }
  }
  try {
    ProxyRepositoryFactory.getInstance().initialize();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  ItemCacheManager.clearCache();
  if (!isMultiNodes()) {
    for (    ExportFileResource process : processes) {
      process.removeAllMap();
      ProcessItem processItem=(ProcessItem)process.getItem();
      if (!processItem.getProperty().getVersion().equals(version)) {
        process.setProcess(ItemCacheManager.getProcessItem(processItem.getProperty().getId(),version));
      }
    }
  }
  manager.setProgressMonitor(monitor);
  List<ExportFileResource> resourcesToExport=null;
  try {
    resourcesToExport=manager.getExportResources(processes.toArray(new ExportFileResource[]{}));
    IStructuredSelection selection=new StructuredSelection(nodes);
    boolean hasErrors=CorePlugin.getDefault().getRunProcessService().checkExportProcess(selection,true);
    if (hasErrors) {
      manager.deleteTempFiles();
      return false;
    }
  }
 catch (  ProcessorException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
  boolean addClasspathJar=true;
  IDesignerCoreService designerCoreService=CoreRuntimePlugin.getInstance().getDesignerCoreService();
  if (designerCoreService != null) {
    addClasspathJar=designerCoreService.getDesignerCorePreferenceStore().getBoolean(IRepositoryPrefConstants.ADD_CLASSPATH_JAR);
  }
  if (isMultiNodes() || addClasspathJar) {
    manager.setTopFolder(resourcesToExport);
  }
  doArchiveExport(monitor,resourcesToExport);
  clean();
  ProcessorUtilities.resetExportConfig();
  boolean generated=generatedCodes(version,monitor,processes);
  if (!generated) {
    return false;
  }
  monitor.subTask(Messages.getString("String_Node_Str",type));
  if (addClasspathJar) {
    reBuildJobZipFile(processes);
  }
 else {
    String zipFile=getTempDestinationValue();
    String destinationZipFile=manager.getDestinationPath();
    FileCopyUtils.copy(zipFile,destinationZipFile);
  }
  return true;
}