Program: 126249
Project: 126249
Buggy source:
private static void generateNodeInfo(JobInfo jobInfo,String selectedContextName,boolean statistics,boolean properties,int option,IProgressMonitor progressMonitor,IProcess currentProcess) throws ProcessorException {
  if (!BitwiseOptionUtils.containOption(option,GENERATE_MAIN_ONLY)) {
    List<? extends INode> graphicalNodes=currentProcess.getGeneratingNodes();
    for (    INode node : graphicalNodes) {
      String componentName=node.getComponent().getName();
      if ((node != null) && (componentName.equals("String_Node_Str") || componentName.equals("String_Node_Str"))) {
        if ("String_Node_Str".equals(componentName)) {
          IElementParameter fromExternal=node.getElementParameter("String_Node_Str");
          Object value=fromExternal.getValue();
          if (value != null && "String_Node_Str".equals(value.toString())) {
            continue;
          }
        }
        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(node.getUniqueName() + "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 (BitwiseOptionUtils.containOption(option,GENERATE_WITH_FIRST_CHILD)) {
                generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_MAIN_ONLY,progressMonitor);
              }
 else {
                generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_ALL_CHILDS,progressMonitor);
                currentProcess.setNeedRegenerateCode(true);
              }
            }
            LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
            LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(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().getPigudfNeededWithSubjobPerJob(jobInfo.getJobId() + "String_Node_Str",jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(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,boolean properties,int option,IProgressMonitor progressMonitor,IProcess currentProcess) throws ProcessorException {
  if (BitwiseOptionUtils.containOption(option,GENERATE_TESTS) && jobInfo.getProcessItem() != null) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
      ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
      if (testContainerService != null) {
        List<ProcessItem> testsItems=testContainerService.getAllTestContainers(jobInfo.getProcessItem());
        for (        ProcessItem testItem : testsItems) {
          JobInfo subJobInfo=new JobInfo(testItem,testItem.getProcess().getDefaultContext());
          subJobInfo.setTestContainer(true);
          if (BitwiseOptionUtils.containOption(option,GENERATE_WITH_FIRST_CHILD)) {
            generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_MAIN_ONLY,progressMonitor);
          }
 else {
            generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_ALL_CHILDS,progressMonitor);
            currentProcess.setNeedRegenerateCode(true);
          }
        }
      }
    }
  }
  jobInfo.setProcessItem(null);
  if (!BitwiseOptionUtils.containOption(option,GENERATE_MAIN_ONLY)) {
    List<? extends INode> graphicalNodes=currentProcess.getGeneratingNodes();
    for (    INode node : graphicalNodes) {
      String componentName=node.getComponent().getName();
      if ((node != null) && (componentName.equals("String_Node_Str") || componentName.equals("String_Node_Str"))) {
        if ("String_Node_Str".equals(componentName)) {
          IElementParameter fromExternal=node.getElementParameter("String_Node_Str");
          Object value=fromExternal.getValue();
          if (value != null && "String_Node_Str".equals(value.toString())) {
            continue;
          }
        }
        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(node.getUniqueName() + "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 (BitwiseOptionUtils.containOption(option,GENERATE_WITH_FIRST_CHILD)) {
                generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_MAIN_ONLY,progressMonitor);
              }
 else {
                generateCode(subJobInfo,selectedContextName,statistics,false,properties,GENERATE_ALL_CHILDS,progressMonitor);
                currentProcess.setNeedRegenerateCode(true);
              }
            }
            LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(subJobInfo.getJobId(),subJobInfo.getJobVersion()));
            LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(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().getPigudfNeededWithSubjobPerJob(jobInfo.getJobId() + "String_Node_Str",jobInfo.getJobVersion()).addAll(LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(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()));
            }
          }
        }
      }
    }
  }
}