Program: 122405
Project: 122405
Buggy source:
/** 
 * The Finish button was pressed. Try to do the required work now and answer a boolean indicating success. If false is returned then the wizard will not close.
 * @returns boolean
 */
public boolean finish(){
  Map<ExportChoice,Object> exportChoiceMap=getExportChoiceMap();
  boolean canExport=false;
  for (  ExportChoice choice : ExportChoice.values()) {
    if (exportChoiceMap.get(choice) != null && exportChoiceMap.get(choice) instanceof Boolean && (Boolean)exportChoiceMap.get(choice)) {
      canExport=true;
      break;
    }
  }
  if (!canExport) {
    MessageDialog.openInformation(getContainer().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return false;
  }
  if (!ensureTargetIsValid()) {
    return false;
  }
  manager=new SpagicJavaDeployManager(exportChoiceMap,contextCombo.getText(),"String_Node_Str",IProcessor.NO_STATISTICS,IProcessor.NO_TRACES);
  String topFolder=getRootFolderName();
  List<ExportFileResource> resourcesToExport=null;
  try {
    resourcesToExport=getExportResources();
  }
 catch (  ProcessorException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
  setTopFolder(resourcesToExport,topFolder);
  saveDirtyEditors();
  saveWidgetValues();
  ArchiveFileExportOperationFullPath exporterOperation=getExporterOperation(resourcesToExport);
  boolean ok=executeExportOperation(exporterOperation);
  manager.deleteTempFiles();
  ProcessorUtilities.resetExportConfig();
  String projectName=((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLabel();
  List<JobResource> jobResources=new ArrayList<JobResource>();
  for (int i=0; i < process.length; i++) {
    try {
      process[i].setProcess((ProcessItem)ProxyRepositoryFactory.getInstance().getUptodateProperty(process[i].getItem().getProperty()).getItem());
    }
 catch (    PersistenceException e) {
      e.printStackTrace();
    }
    ProcessItem processItem=(ProcessItem)process[i].getItem();
    JobInfo jobInfo=new JobInfo(processItem,processItem.getProcess().getDefaultContext());
    jobResources.add(new JobResource(projectName,jobInfo));
    Set<JobInfo> jobInfos=ProcessorUtilities.getChildrenJobInfo(processItem);
    for (    JobInfo subjobInfo : jobInfos) {
      jobResources.add(new JobResource(projectName,subjobInfo));
    }
  }
  JobResourceManager reManager=JobResourceManager.getInstance();
  for (  JobResource r : jobResources) {
    if (reManager.isProtected(r)) {
      try {
        ProcessorUtilities.generateCode(r.getJobInfo().getJobId(),r.getJobInfo().getContextName(),r.getJobInfo().getJobVersion(),false,false);
      }
 catch (      ProcessorException e) {
        ExceptionHandler.process(e);
      }
    }
 else {
      reManager.deleteResource(r);
    }
  }
  return ok;
}

Fixed version (ground truth):
/** 
 * The Finish button was pressed. Try to do the required work now and answer a boolean indicating success. If false is returned then the wizard will not close.
 * @returns boolean
 */
@Override public boolean finish(){
  Map<ExportChoice,Object> exportChoiceMap=getExportChoiceMap();
  boolean canExport=false;
  for (  ExportChoice choice : ExportChoice.values()) {
    if (exportChoiceMap.get(choice) != null && exportChoiceMap.get(choice) instanceof Boolean && (Boolean)exportChoiceMap.get(choice)) {
      canExport=true;
      break;
    }
  }
  if (!canExport) {
    MessageDialog.openInformation(getContainer().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return false;
  }
  if (!ensureTargetIsValid()) {
    return false;
  }
  manager=new SpagicJavaDeployManager(exportChoiceMap,contextCombo.getText(),"String_Node_Str",IProcessor.NO_STATISTICS,IProcessor.NO_TRACES);
  String topFolder=getRootFolderName();
  List<ExportFileResource> resourcesToExport=null;
  try {
    resourcesToExport=getExportResources();
  }
 catch (  ProcessorException e) {
    MessageBoxExceptionHandler.process(e);
    return false;
  }
  setTopFolder(resourcesToExport,topFolder);
  saveDirtyEditors();
  saveWidgetValues();
  ArchiveFileExportOperationFullPath exporterOperation=getExporterOperation(resourcesToExport);
  boolean ok=executeExportOperation(exporterOperation);
  manager.deleteTempFiles();
  ProcessorUtilities.resetExportConfig();
  String projectName=((RepositoryContext)CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLabel();
  List<JobResource> jobResources=new ArrayList<JobResource>();
  for (  ExportFileResource proces : process) {
    try {
      proces.setProcess((ProcessItem)ProxyRepositoryFactory.getInstance().getUptodateProperty(proces.getItem().getProperty()).getItem());
    }
 catch (    PersistenceException e) {
      e.printStackTrace();
    }
    ProcessItem processItem=(ProcessItem)proces.getItem();
    JobInfo jobInfo=new JobInfo(processItem,processItem.getProcess().getDefaultContext());
    jobResources.add(new JobResource(projectName,jobInfo));
    Set<JobInfo> jobInfos=ProcessorUtilities.getChildrenJobInfo(processItem);
    for (    JobInfo subjobInfo : jobInfos) {
      jobResources.add(new JobResource(projectName,subjobInfo));
    }
  }
  JobResourceManager reManager=JobResourceManager.getInstance();
  for (  JobResource r : jobResources) {
    if (reManager.isProtected(r)) {
      try {
        ProcessorUtilities.generateCode(r.getJobInfo().getJobId(),r.getJobInfo().getContextName(),r.getJobInfo().getJobVersion(),false,false);
      }
 catch (      ProcessorException e) {
        ExceptionHandler.process(e);
      }
    }
 else {
      reManager.deleteResource(r);
    }
  }
  return ok;
}