Program: 125250
Project: 125250
Buggy source:
private static Set<JobInfo> getAllJobInfo(ProcessType ptype,JobInfo parentJobInfo,Set<JobInfo> jobInfos,boolean firstChildOnly){
  if (ptype == null) {
    return jobInfos;
  }
  EList<NodeType> nodes=ptype.getNode();
  String jobletPaletteType=null;
  String frameWork=ptype.getFramework();
  if (frameWork == null) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_DI.getName();
  }
 else   if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_SPARK.getName();
  }
 else   if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
  }
  for (  NodeType node : nodes) {
    boolean activate=true;
    for (    Object o : node.getElementParameter()) {
      ElementParameterType param=(ElementParameterType)o;
      if ("String_Node_Str".equals(param.getName())) {
        activate="String_Node_Str".equals(param.getValue());
        break;
      }
    }
    if (!activate) {
      continue;
    }
    boolean isCTalendJob="String_Node_Str".equalsIgnoreCase(node.getComponentName());
    boolean isRoutelet=isRouteletNode(node);
    if ("String_Node_Str".equalsIgnoreCase(node.getComponentName()) || isCTalendJob || isRoutelet) {
      String jobIds=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String jobContext=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String jobVersion=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String[] jobsArr=jobIds.split(ProcessorUtilities.COMMA);
      for (      String jobId : jobsArr) {
        if (StringUtils.isNotEmpty(jobId)) {
          ProcessItem processItem=ItemCacheManager.getProcessItem(jobId,jobVersion);
          if (processItem != null) {
            JobInfo jobInfo=new JobInfo(processItem,jobContext);
            if (!jobInfos.contains(jobInfo)) {
              jobInfos.add(jobInfo);
              jobInfo.setFatherJobInfo(parentJobInfo);
              if (!firstChildOnly) {
                getAllJobInfo(processItem.getProcess(),jobInfo,jobInfos,firstChildOnly);
              }
            }
          }
        }
      }
    }
 else {
      if (jobletPaletteType != null && PluginChecker.isJobLetPluginLoaded()) {
        IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
        if (service != null) {
          IComponent jobletComponent=service.getJobletComponent(node,jobletPaletteType);
          ProcessType jobletProcess=service.getJobletProcess(jobletComponent);
          if (jobletComponent != null) {
            if (!firstChildOnly) {
              getAllJobInfo(jobletProcess,parentJobInfo,jobInfos,firstChildOnly);
            }
 else {
              Property property=service.getJobletComponentItem(jobletComponent);
              JobInfo jobInfo=new JobInfo(property,jobletProcess.getDefaultContext());
              if (!jobInfos.contains(jobInfo)) {
                jobInfos.add(jobInfo);
                jobInfo.setFatherJobInfo(parentJobInfo);
              }
            }
          }
        }
      }
    }
  }
  if (!parentJobInfo.isTestContainer() && !parentJobInfo.isJoblet() && GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      List<ProcessItem> testsItems=testContainerService.getTestContainersByVersion(parentJobInfo.getProcessItem());
      for (      ProcessItem testItem : testsItems) {
        ProcessType testProcess=testContainerService.getTestContainerProcess(testItem);
        if (testItem.getProcess() == null) {
          testItem.setProcess(testProcess);
        }
        if (testProcess == null) {
          log.warn(Messages.getString("String_Node_Str"));
          continue;
        }
        JobInfo jobInfo=new JobInfo(testItem,testProcess.getDefaultContext());
        jobInfo.setTestContainer(true);
        jobInfos.add(jobInfo);
        jobInfo.setFatherJobInfo(parentJobInfo);
      }
    }
  }
  return jobInfos;
}

Fixed version (ground truth):
private static Set<JobInfo> getAllJobInfo(ProcessType ptype,JobInfo parentJobInfo,Set<JobInfo> jobInfos,boolean firstChildOnly){
  if (ptype == null) {
    return jobInfos;
  }
  EList<NodeType> nodes=ptype.getNode();
  String jobletPaletteType=null;
  String frameWork=ptype.getFramework();
  if (frameWork == null) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_DI.getName();
  }
 else   if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_SPARK.getName();
  }
 else   if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
    jobletPaletteType=ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
  }
  for (  NodeType node : nodes) {
    boolean activate=true;
    for (    Object o : node.getElementParameter()) {
      ElementParameterType param=(ElementParameterType)o;
      if ("String_Node_Str".equals(param.getName())) {
        activate="String_Node_Str".equals(param.getValue());
        break;
      }
    }
    if (!activate) {
      continue;
    }
    boolean isCTalendJob="String_Node_Str".equalsIgnoreCase(node.getComponentName());
    boolean isRoutelet=isRouteletNode(node);
    if ("String_Node_Str".equalsIgnoreCase(node.getComponentName()) || isCTalendJob || isRoutelet) {
      String jobIds=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String jobContext=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String jobVersion=getParameterValue(node.getElementParameter(),isCTalendJob ? "String_Node_Str" : "String_Node_Str" + (isRoutelet ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
      String[] jobsArr=jobIds.split(ProcessorUtilities.COMMA);
      for (      String jobId : jobsArr) {
        if (StringUtils.isNotEmpty(jobId)) {
          ProcessItem processItem=ItemCacheManager.getProcessItem(jobId,jobVersion);
          if (processItem != null) {
            JobInfo jobInfo=new JobInfo(processItem,jobContext);
            if (!jobInfos.contains(jobInfo)) {
              jobInfos.add(jobInfo);
              jobInfo.setFatherJobInfo(parentJobInfo);
              if (!firstChildOnly) {
                getAllJobInfo(processItem.getProcess(),jobInfo,jobInfos,firstChildOnly);
              }
            }
          }
        }
      }
    }
 else {
      if (jobletPaletteType != null && PluginChecker.isJobLetPluginLoaded()) {
        IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
        if (service != null) {
          IComponent jobletComponent=service.getJobletComponent(node,jobletPaletteType);
          ProcessType jobletProcess=service.getJobletProcess(jobletComponent);
          if (jobletComponent != null) {
            if (!firstChildOnly) {
              getAllJobInfo(jobletProcess,parentJobInfo,jobInfos,firstChildOnly);
            }
 else {
              Project project=null;
              String componentName=node.getComponentName();
              String[] array=componentName.split("String_Node_Str");
              if (array.length == 2) {
                String projectTechName=array[0];
                project=ProjectManager.getInstance().getProjectFromProjectTechLabel(projectTechName);
              }
 else {
                project=ProjectManager.getInstance().getCurrentProject();
              }
              Property property=service.getJobletComponentItem(jobletComponent);
              Project currentProject=ProjectManager.getInstance().getCurrentProject();
              if (project != null && !project.getTechnicalLabel().equals(currentProject.getTechnicalLabel())) {
                try {
                  property=ProxyRepositoryFactory.getInstance().getSpecificVersion(project,property.getId(),property.getVersion(),true).getProperty();
                }
 catch (                PersistenceException e) {
                  ExceptionHandler.process(e);
                }
              }
              JobInfo jobInfo=new JobInfo(property,jobletProcess.getDefaultContext());
              if (!jobInfos.contains(jobInfo)) {
                jobInfos.add(jobInfo);
                jobInfo.setFatherJobInfo(parentJobInfo);
              }
            }
          }
        }
      }
    }
  }
  if (!parentJobInfo.isTestContainer() && !parentJobInfo.isJoblet() && GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      List<ProcessItem> testsItems=testContainerService.getTestContainersByVersion(parentJobInfo.getProcessItem());
      for (      ProcessItem testItem : testsItems) {
        ProcessType testProcess=testContainerService.getTestContainerProcess(testItem);
        if (testItem.getProcess() == null) {
          testItem.setProcess(testProcess);
        }
        if (testProcess == null) {
          log.warn(Messages.getString("String_Node_Str"));
          continue;
        }
        JobInfo jobInfo=new JobInfo(testItem,testProcess.getDefaultContext());
        jobInfo.setTestContainer(true);
        jobInfos.add(jobInfo);
        jobInfo.setFatherJobInfo(parentJobInfo);
      }
    }
  }
  return jobInfos;
}