Program: 128828
Project: 128828
Buggy source:
private static void generateNodeInfo(JobInfo jobInfo,String selectedContextName,boolean statistics,int option,IProgressMonitor progressMonitor,IProcess currentProcess) throws ProcessorException {
  if (option != GENERATE_MAIN_ONLY) {
    List<? extends INode> graphicalNodes=currentProcess.getGeneratingNodes();
    for (    INode node : graphicalNodes) {
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        IElementParameter processIdparam=node.getElementParameter("String_Node_Str");
        String jobIds=(String)processIdparam.getValue();
        String[] jobsArr=jobIds.split(ProcessorUtilities.COMMA);
        for (        String jobId : jobsArr) {
          if (StringUtils.isNotEmpty(jobId)) {
            ProcessItem processItem=null;
            String context=(String)node.getElementParameter("String_Node_Str").getValue();
            String version=(String)node.getElementParameter("String_Node_Str").getValue();
            JobInfo subJobInfo=null;
            subJobInfo=new JobInfo(jobId,context,version);
            processItem=ItemCacheManager.getProcessItem(jobId,version);
            if (processItem == null) {
              throw new ProcessorException("String_Node_Str" + currentProcess.getName());
            }
            subJobInfo.setJobVersion(processItem.getProperty().getVersion());
            if (jobInfo.isApplyContextToChildren()) {
              subJobInfo.setApplyContextToChildren(jobInfo.isApplyContextToChildren());
              if (checkIfContextExisted(processItem,selectedContextName)) {
                subJobInfo.setContextName(selectedContextName);
              }
 else {
                String defaultContext=processItem.getProcess().getDefaultContext();
                node.getElementParameter("String_Node_Str").setValue(defaultContext);
                subJobInfo.setContextName(defaultContext);
              }
            }
            subJobInfo.setFatherJobInfo(jobInfo);
            if (!jobList.contains(subJobInfo)) {
              if (option == GENERATE_WITH_FIRST_CHILD) {
                generateCode(subJobInfo,selectedContextName,statistics,false,true,GENERATE_MAIN_ONLY,progressMonitor);
              }
 else {
                generateCode(subJobInfo,selectedContextName,statistics,false,true,GENERATE_ALL_CHILDS,progressMonitor);
              }
              LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              if (exportAsOSGI) {
                LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId() + "String_Node_Str",jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId() + "String_Node_Str",subJobInfo.getJobVersion()));
              }
              LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              if (!LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
                LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),LastGenerationInfo.getInstance().isUseDynamic(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void generateNodeInfo(JobInfo jobInfo,String selectedContextName,boolean statistics,int option,IProgressMonitor progressMonitor,IProcess currentProcess) throws ProcessorException {
  if (option != GENERATE_MAIN_ONLY) {
    List<? extends INode> graphicalNodes=currentProcess.getGeneratingNodes();
    for (    INode node : graphicalNodes) {
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        IElementParameter processIdparam=node.getElementParameter("String_Node_Str");
        String jobIds=(String)processIdparam.getValue();
        String[] jobsArr=jobIds.split(ProcessorUtilities.COMMA);
        for (        String jobId : jobsArr) {
          if (StringUtils.isNotEmpty(jobId)) {
            ProcessItem processItem=null;
            String context=(String)node.getElementParameter("String_Node_Str").getValue();
            String version=(String)node.getElementParameter("String_Node_Str").getValue();
            JobInfo subJobInfo=null;
            subJobInfo=new JobInfo(jobId,context,version);
            processItem=ItemCacheManager.getProcessItem(jobId,version);
            if (processItem == null) {
              throw new ProcessorException("String_Node_Str" + currentProcess.getName());
            }
            subJobInfo.setJobVersion(processItem.getProperty().getVersion());
            if (jobInfo.isApplyContextToChildren()) {
              subJobInfo.setApplyContextToChildren(jobInfo.isApplyContextToChildren());
              if (checkIfContextExisted(processItem,selectedContextName)) {
                subJobInfo.setContextName(selectedContextName);
              }
 else {
                String defaultContext=processItem.getProcess().getDefaultContext();
                node.getElementParameter("String_Node_Str").setValue(defaultContext);
                subJobInfo.setContextName(defaultContext);
              }
            }
            subJobInfo.setFatherJobInfo(jobInfo);
            if (!jobList.contains(subJobInfo)) {
              if (option == GENERATE_WITH_FIRST_CHILD) {
                generateCode(subJobInfo,selectedContextName,statistics,false,true,GENERATE_MAIN_ONLY,progressMonitor);
              }
 else {
                generateCode(subJobInfo,selectedContextName,statistics,false,true,GENERATE_ALL_CHILDS,progressMonitor);
                currentProcess.setNeedRegenerateCode(true);
              }
              LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              if (exportAsOSGI) {
                LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId() + "String_Node_Str",jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId() + "String_Node_Str",subJobInfo.getJobVersion()));
              }
              LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getRoutinesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              if (!LastGenerationInfo.getInstance().isUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion())) {
                LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(),jobInfo.getJobVersion(),LastGenerationInfo.getInstance().isUseDynamic(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
              }
            }
          }
        }
      }
    }
  }
}