Program: 117819
Project: 117819
Buggy source:
@Override public List<String> extractArgumentSegments(){
  List<String> list=new ArrayList<>();
  list.add(ProcessorConstants.CMD_KEY_WORD_LIBJAR);
  StringBuffer libJars=new StringBuffer();
  Set<String> libNames=new HashSet<>();
  boolean isExport=isExportConfig() || isRunAsExport();
  if (process instanceof IProcess2) {
    if (isExport) {
      libNames=JavaProcessorUtilities.extractLibNamesOnlyForMapperAndReducer((IProcess2)process);
    }
 else {
      libNames=JavaProcessorUtilities.extractLibNamesOnlyForMapperAndReducerWithoutRoutines((IProcess2)process);
    }
  }
  Set<ModuleNeeded> modulesNeeded=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(process.getId(),process.getVersion());
  Set<String> allNeededLibsAfterAdjuster=new HashSet<String>();
  for (  ModuleNeeded module : modulesNeeded) {
    allNeededLibsAfterAdjuster.add(module.getModuleName());
  }
  Iterator<String> it=libNames.iterator();
  while (it.hasNext()) {
    String jarName=it.next();
    if (!allNeededLibsAfterAdjuster.contains(jarName) && !JavaUtils.ROUTINES_JAR.equals(jarName) && !JavaUtils.BEANS_JAR.equals(jarName)&& !JavaUtils.PIGUDFS_JAR.equals(jarName)) {
      it.remove();
    }
  }
  File libDir=JavaProcessorUtilities.getJavaProjectLibFolder();
  String libFolder="String_Node_Str";
  if (libDir != null) {
    libFolder=new Path(libDir.getAbsolutePath()).toPortableString();
  }
  boolean needAllLibJars=true;
  if (needsShade()) {
    BigDataJobUtil bdUtil=new BigDataJobUtil((ProcessItem)this.getProperty().getItem());
    if (bdUtil.isMRWithHDInsight()) {
      needAllLibJars=false;
    }
  }
  if (libNames != null && libNames.size() > 0 && needAllLibJars) {
    Iterator<String> itLibNames=libNames.iterator();
    while (itLibNames.hasNext()) {
      if (isExport) {
        libJars.append(getLibFolderInWorkingDir() + itLibNames.next()).append(',');
      }
 else {
        libJars.append(libFolder + "String_Node_Str" + itLibNames.next()).append(',');
      }
    }
  }
  if (isExport) {
    libJars.append("String_Node_Str" + makeupJobJarName());
  }
 else {
    if (needAllLibJars) {
      ITalendProcessJavaProject routineProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.ROUTINES);
      IFile routinesJar=routineProject.getTargetFolder().getFile(JavaUtils.ROUTINE_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
      libJars.append(routinesJar.getLocation().toPortableString() + "String_Node_Str");
      if (ProcessUtils.isRequiredPigUDFs(process)) {
        ITalendProcessJavaProject pigudfProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.PIG_UDF);
        IFile pigudfsJar=pigudfProject.getTargetFolder().getFile(JavaUtils.PIGUDFS_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
        libJars.append(pigudfsJar.getLocation().toPortableString() + "String_Node_Str");
      }
      if (ProcessUtils.isRequiredBeans(process)) {
        ITalendProcessJavaProject beansProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.valueOf("String_Node_Str"));
        IFile beansJar=beansProject.getTargetFolder().getFile(JavaUtils.BEANS_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
        libJars.append(beansJar.getLocation().toPortableString() + "String_Node_Str");
      }
    }
    libJars.append(getTalendJavaProject().getTargetFolder().getLocation().toPortableString() + "String_Node_Str" + makeupJobJarName());
  }
  list.add(libJars.toString());
  return list;
}

Fixed version (ground truth):
@Override public List<String> extractArgumentSegments(){
  List<String> list=new ArrayList<>();
  list.add(ProcessorConstants.CMD_KEY_WORD_LIBJAR);
  StringBuffer libJars=new StringBuffer();
  Set<String> libNames=new HashSet<>();
  boolean isExport=isExportConfig() || isRunAsExport();
  if (process instanceof IProcess2) {
    if (isExport) {
      libNames=JavaProcessorUtilities.extractLibNamesOnlyForMapperAndReducer((IProcess2)process);
    }
 else {
      libNames=JavaProcessorUtilities.extractLibNamesOnlyForMapperAndReducerWithoutRoutines((IProcess2)process);
    }
  }
  Set<ModuleNeeded> modulesNeeded=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(process.getId(),process.getVersion());
  Set<String> allNeededLibsAfterAdjuster=new HashSet<String>();
  for (  ModuleNeeded module : modulesNeeded) {
    allNeededLibsAfterAdjuster.add(module.getModuleName());
  }
  Iterator<String> it=libNames.iterator();
  while (it.hasNext()) {
    String jarName=it.next();
    if (!allNeededLibsAfterAdjuster.contains(jarName) && !JavaUtils.ROUTINES_JAR.equals(jarName) && !JavaUtils.BEANS_JAR.equals(jarName)&& !JavaUtils.PIGUDFS_JAR.equals(jarName)) {
      it.remove();
    }
  }
  File libDir=JavaProcessorUtilities.getJavaProjectLibFolder();
  String libFolder="String_Node_Str";
  if (libDir != null) {
    libFolder=new Path(libDir.getAbsolutePath()).toPortableString();
  }
  boolean needAllLibJars=true;
  if (needsShade()) {
    BigDataJobUtil bdUtil=new BigDataJobUtil((ProcessItem)this.getProperty().getItem());
    if (bdUtil.isMRWithHDInsight()) {
      needAllLibJars=false;
    }
  }
  if (libNames != null && libNames.size() > 0 && needAllLibJars) {
    Iterator<String> itLibNames=libNames.iterator();
    while (itLibNames.hasNext()) {
      if (isExport) {
        libJars.append(getLibFolderInWorkingDir() + itLibNames.next()).append(',');
      }
 else {
        libJars.append(libFolder + "String_Node_Str" + itLibNames.next()).append(',');
      }
    }
  }
  if (isExport) {
    libJars.append("String_Node_Str" + makeupJobJarName());
    if (!needAllLibJars) {
      libJars.append("String_Node_Str");
    }
  }
 else {
    if (needAllLibJars) {
      ITalendProcessJavaProject routineProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.ROUTINES);
      IFile routinesJar=routineProject.getTargetFolder().getFile(JavaUtils.ROUTINE_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
      libJars.append(routinesJar.getLocation().toPortableString() + "String_Node_Str");
      if (ProcessUtils.isRequiredPigUDFs(process)) {
        ITalendProcessJavaProject pigudfProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.PIG_UDF);
        IFile pigudfsJar=pigudfProject.getTargetFolder().getFile(JavaUtils.PIGUDFS_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
        libJars.append(pigudfsJar.getLocation().toPortableString() + "String_Node_Str");
      }
      if (ProcessUtils.isRequiredBeans(process)) {
        ITalendProcessJavaProject beansProject=TalendJavaProjectManager.getTalendCodeJavaProject(ERepositoryObjectType.valueOf("String_Node_Str"));
        IFile beansJar=beansProject.getTargetFolder().getFile(JavaUtils.BEANS_JAR_NAME + "String_Node_Str" + PomUtil.getDefaultMavenVersion()+ FileExtensions.JAR_FILE_SUFFIX);
        libJars.append(beansJar.getLocation().toPortableString() + "String_Node_Str");
      }
    }
    libJars.append(getTalendJavaProject().getTargetFolder().getLocation().toPortableString() + "String_Node_Str" + makeupJobJarName());
  }
  list.add(libJars.toString());
  return list;
}