Program: 121404
Project: 121404
Buggy source:
private static void getNeededModules(final IProcess process,boolean withChildrens,Set<ProcessItem> searchItems,List<ModuleNeeded> modulesNeeded,boolean forMR){
  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)) {
          modulesNeeded.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)) {
          modulesNeeded.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter elementParameter=process.getElementParameter(EParameterName.DRIVER_JAR.getName());
  if (elementParameter != null && elementParameter.getFieldType() == EParameterFieldType.TABLE) {
    getModulesInTable(process,elementParameter,modulesNeeded);
  }
  if (process instanceof IProcess2) {
    Item item=((IProcess2)process).getProperty().getItem();
    if (item instanceof ProcessItem) {
      List<ModuleNeeded> modulesNeededForRoutines=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item,ERepositoryObjectType.ROUTINES);
      if (modulesNeededForRoutines != null) {
        modulesNeeded.addAll(modulesNeededForRoutines);
      }
      List<ModuleNeeded> modulesNeededForPigudf=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item,ERepositoryObjectType.PIG_UDF);
      if (modulesNeededForPigudf != null) {
        modulesNeeded.addAll(modulesNeededForPigudf);
      }
    }
  }
  List<? extends INode> nodeList=process.getGeneratingNodes();
  for (  INode node : nodeList) {
    addNodeRelatedModules(process,modulesNeeded,node,forMR);
    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.getNeededModules(child,true,searchItems,modulesNeeded,forMR);
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void getNeededModules(final IProcess process,boolean withChildrens,Set<ProcessItem> searchItems,List<ModuleNeeded> modulesNeeded,boolean forMR){
  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) + 1) {
        String substring=headerLibraries.substring(headerLibraries.lastIndexOf(File.separatorChar) + 1);
        if (!"String_Node_Str".equals(substring)) {
          modulesNeeded.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) + 1) {
        String substring=footerLibraries.substring(footerLibraries.lastIndexOf(File.separatorChar) + 1);
        if (!"String_Node_Str".equals(substring)) {
          modulesNeeded.add(getModuleValue(process,substring));
        }
      }
    }
  }
  IElementParameter elementParameter=process.getElementParameter(EParameterName.DRIVER_JAR.getName());
  if (elementParameter != null && elementParameter.getFieldType() == EParameterFieldType.TABLE) {
    getModulesInTable(process,elementParameter,modulesNeeded);
  }
  if (process instanceof IProcess2) {
    Item item=((IProcess2)process).getProperty().getItem();
    if (item instanceof ProcessItem) {
      List<ModuleNeeded> modulesNeededForRoutines=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item,ERepositoryObjectType.ROUTINES);
      if (modulesNeededForRoutines != null) {
        modulesNeeded.addAll(modulesNeededForRoutines);
      }
      List<ModuleNeeded> modulesNeededForPigudf=ModulesNeededProvider.getModulesNeededForRoutines((ProcessItem)item,ERepositoryObjectType.PIG_UDF);
      if (modulesNeededForPigudf != null) {
        modulesNeeded.addAll(modulesNeededForPigudf);
      }
    }
  }
  List<? extends INode> nodeList=process.getGeneratingNodes();
  for (  INode node : nodeList) {
    addNodeRelatedModules(process,modulesNeeded,node,forMR);
    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.getNeededModules(child,true,searchItems,modulesNeeded,forMR);
        }
      }
    }
  }
}