Program: 124103
Project: 124103
Buggy source:
private static void getNeededLibraries(final IProcess process,boolean withChildrens,Set<ProcessItem> searchItems,Set<String> neededLibraries,Set<String> bundleDefinedLibraries,boolean... isExportOSGI){
  boolean exportOSGI=false;
  if (isExportOSGI != null && isExportOSGI.length == 1) {
    exportOSGI=isExportOSGI[0];
  }
  IElementParameter headerParameter=process.getElementParameter(EParameterName.HEADER_LIBRARY.getName());
  if (headerParameter != null) {
    Object value=headerParameter.getValue();
    if (value != null) {
      String headerLibraries=(String)value;
      if (headerLibraries.indexOf(File.separatorChar) > 0 && headerLibraries.length() > headerLibraries.lastIndexOf(File.separatorChar) + 2) {
        String substring=headerLibraries.substring(headerLibraries.lastIndexOf(File.separatorChar) + 2);
        if (!"String_Node_Str".equals(substring)) {
          neededLibraries.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter footerParameter=process.getElementParameter(EParameterName.FOOTER_LIBRARY.getName());
  if (footerParameter != null) {
    Object value=footerParameter.getValue();
    if (value != null) {
      String footerLibraries=(String)value;
      if (footerLibraries.indexOf(File.separatorChar) > 0 && footerLibraries.length() > footerLibraries.lastIndexOf(File.separatorChar) + 2) {
        String substring=footerLibraries.substring(footerLibraries.lastIndexOf(File.separatorChar) + 2);
        if (!"String_Node_Str".equals(substring)) {
          neededLibraries.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter elementParameter=process.getElementParameter(EParameterName.DRIVER_JAR.getName());
  if (elementParameter != null && elementParameter.getFieldType() == EParameterFieldType.TABLE) {
    getModulsInTable(process,elementParameter,neededLibraries);
  }
  if (process instanceof IProcess2) {
    Item item=((IProcess2)process).getProperty().getItem();
    if (item instanceof ProcessItem) {
      List<ModuleNeeded> modulesNeededForRoutines=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item);
      if (modulesNeededForRoutines != null) {
        for (        ModuleNeeded moduleNeeded : modulesNeededForRoutines) {
          neededLibraries.add(moduleNeeded.getModuleName());
        }
      }
    }
  }
  List<? extends INode> nodeList=process.getGeneratingNodes();
  for (  INode node : nodeList) {
    List<ModuleNeeded> moduleList=node.getModulesNeeded();
    boolean flag=false;
    for (    ModuleNeeded needed : moduleList) {
      if (needed.getRequiredIf() != null) {
        flag=true;
      }
    }
    for (    ModuleNeeded needed : moduleList) {
      if (flag) {
        if (needed.isShowRequiredIf(node.getElementParameters())) {
          if (!exportOSGI) {
            neededLibraries.add(needed.getModuleName());
          }
 else           if (needed.getBundleName() == null && needed.getBundleVersion() == null) {
            neededLibraries.add(needed.getModuleName());
          }
 else {
            bundleDefinedLibraries.add(needed.getModuleName());
          }
        }
      }
 else {
        if (needed.isRequired()) {
          if (!exportOSGI) {
            neededLibraries.add(needed.getModuleName());
          }
 else           if (needed.getBundleName() == null && needed.getBundleVersion() == null) {
            neededLibraries.add(needed.getModuleName());
          }
 else {
            bundleDefinedLibraries.add(needed.getModuleName());
          }
        }
      }
    }
    for (    IElementParameter curParam : node.getElementParameters()) {
      if (curParam.getFieldType() == null) {
        continue;
      }
      if (curParam.getFieldType().equals(EParameterFieldType.MODULE_LIST)) {
        if (curParam.getValue() != null && !"String_Node_Str".equals(curParam.getValue())) {
          neededLibraries.add(getModuleValue(process,(String)curParam.getValue()));
        }
      }
 else       if (curParam.getFieldType() == EParameterFieldType.TABLE) {
        getModulsInTable(process,curParam,neededLibraries);
      }
      if (curParam.isShow(node.getElementParameters())) {
        findMoreLibraries(process,neededLibraries,curParam,true);
      }
 else {
        findMoreLibraries(process,neededLibraries,curParam,false);
      }
    }
    if (withChildrens) {
      if (node.getComponent().getName().equals("String_Node_Str")) {
        IElementParameter processIdparam=node.getElementParameter("String_Node_Str");
        IElementParameter processVersionParam=node.getElementParameter(EParameterName.PROCESS_TYPE_VERSION.getName());
        ProcessItem processItem=null;
        if (processVersionParam != null) {
          processItem=ItemCacheManager.getProcessItem((String)processIdparam.getValue(),(String)processVersionParam.getValue());
        }
 else {
          processItem=ItemCacheManager.getProcessItem((String)processIdparam.getValue());
        }
        String context=(String)node.getElementParameter("String_Node_Str").getValue();
        if (processItem != null && !searchItems.contains(processItem)) {
          searchItems.add(processItem);
          JobInfo subJobInfo=new JobInfo(processItem,context);
          IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
          IProcess child=service.getProcessFromItem(subJobInfo.getProcessItem());
          JavaProcessUtil.getNeededLibraries(child,true,searchItems,neededLibraries,bundleDefinedLibraries,isExportOSGI);
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void getNeededLibraries(final IProcess process,boolean withChildrens,Set<ProcessItem> searchItems,Set<String> neededLibraries,Set<String> bundleDefinedLibraries,boolean... isExportOSGI){
  boolean exportOSGI=false;
  if (isExportOSGI != null && isExportOSGI.length == 1) {
    exportOSGI=isExportOSGI[0];
  }
  IElementParameter headerParameter=process.getElementParameter(EParameterName.HEADER_LIBRARY.getName());
  if (headerParameter != null) {
    Object value=headerParameter.getValue();
    if (value != null) {
      String headerLibraries=(String)value;
      if (headerLibraries.indexOf(File.separatorChar) > 0 && headerLibraries.length() > headerLibraries.lastIndexOf(File.separatorChar) + 2) {
        String substring=headerLibraries.substring(headerLibraries.lastIndexOf(File.separatorChar) + 2);
        if (!"String_Node_Str".equals(substring)) {
          neededLibraries.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter footerParameter=process.getElementParameter(EParameterName.FOOTER_LIBRARY.getName());
  if (footerParameter != null) {
    Object value=footerParameter.getValue();
    if (value != null) {
      String footerLibraries=(String)value;
      if (footerLibraries.indexOf(File.separatorChar) > 0 && footerLibraries.length() > footerLibraries.lastIndexOf(File.separatorChar) + 2) {
        String substring=footerLibraries.substring(footerLibraries.lastIndexOf(File.separatorChar) + 2);
        if (!"String_Node_Str".equals(substring)) {
          neededLibraries.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter elementParameter=process.getElementParameter(EParameterName.DRIVER_JAR.getName());
  if (elementParameter != null && elementParameter.getFieldType() == EParameterFieldType.TABLE) {
    getModulsInTable(process,elementParameter,neededLibraries);
  }
  if (process instanceof IProcess2) {
    Item item=((IProcess2)process).getProperty().getItem();
    if (item instanceof ProcessItem) {
      List<ModuleNeeded> modulesNeededForRoutines=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item);
      if (modulesNeededForRoutines != null) {
        for (        ModuleNeeded moduleNeeded : modulesNeededForRoutines) {
          neededLibraries.add(moduleNeeded.getModuleName());
        }
      }
    }
  }
  List<? extends INode> nodeList=process.getGeneratingNodes();
  for (  INode node : nodeList) {
    List<ModuleNeeded> moduleList=node.getModulesNeeded();
    for (    ModuleNeeded needed : moduleList) {
      if (needed.isRequired(node.getElementParameters())) {
        if (!exportOSGI) {
          neededLibraries.add(needed.getModuleName());
        }
 else         if (needed.getBundleName() == null && needed.getBundleVersion() == null) {
          neededLibraries.add(needed.getModuleName());
        }
 else {
          bundleDefinedLibraries.add(needed.getModuleName());
        }
      }
    }
    for (    IElementParameter curParam : node.getElementParameters()) {
      if (curParam.getFieldType() == null) {
        continue;
      }
      if (curParam.getFieldType().equals(EParameterFieldType.MODULE_LIST)) {
        if (curParam.getValue() != null && !"String_Node_Str".equals(curParam.getValue())) {
          neededLibraries.add(getModuleValue(process,(String)curParam.getValue()));
        }
      }
 else       if (curParam.getFieldType() == EParameterFieldType.TABLE) {
        getModulsInTable(process,curParam,neededLibraries);
      }
      if (curParam.isShow(node.getElementParameters())) {
        findMoreLibraries(process,neededLibraries,curParam,true);
      }
 else {
        findMoreLibraries(process,neededLibraries,curParam,false);
      }
    }
    if (withChildrens) {
      if (node.getComponent().getName().equals("String_Node_Str")) {
        IElementParameter processIdparam=node.getElementParameter("String_Node_Str");
        IElementParameter processVersionParam=node.getElementParameter(EParameterName.PROCESS_TYPE_VERSION.getName());
        ProcessItem processItem=null;
        if (processVersionParam != null) {
          processItem=ItemCacheManager.getProcessItem((String)processIdparam.getValue(),(String)processVersionParam.getValue());
        }
 else {
          processItem=ItemCacheManager.getProcessItem((String)processIdparam.getValue());
        }
        String context=(String)node.getElementParameter("String_Node_Str").getValue();
        if (processItem != null && !searchItems.contains(processItem)) {
          searchItems.add(processItem);
          JobInfo subJobInfo=new JobInfo(processItem,context);
          IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
          IProcess child=service.getProcessFromItem(subJobInfo.getProcessItem());
          JavaProcessUtil.getNeededLibraries(child,true,searchItems,neededLibraries,bundleDefinedLibraries,isExportOSGI);
        }
      }
    }
  }
}