Program: 37055
Project: 37055
Buggy source:
/** 
 * Scan the arguments for -i -x -xf -if followed by the option -src, -sourcepath, -modulepath or -classpath and produce a map of all the files to referenced for that particular option. Store the found sources and the found modules in the supplied maps.
 */
private boolean findFiles(String[] args,String option,Set<String> suffixes,Map<String,Source> found_files,Map<String,Module> found_modules,Module current_module,boolean inLinksrc) throws ProblemException, ProblemException {
  Set<File> roots=new HashSet<File>();
  List<String> includes=new LinkedList<String>();
  List<String> excludes=new LinkedList<String>();
  List<String> excludefiles=new LinkedList<String>();
  List<String> includefiles=new LinkedList<String>();
  List<String> moduleinfo=new LinkedList<String>();
  moduleinfo.add("String_Node_Str");
  for (int i=0; i < args.length; ++i) {
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String incl=args[i + 1];
      checkPattern(incl);
      includes.add(incl);
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String excl=args[i + 1];
      checkPattern(excl);
      excludes.add(excl);
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String exclf=args[i + 1];
      checkFilePattern(exclf);
      exclf=Util.normalizeDriveLetter(exclf);
      excludefiles.add(fixupSeparator(exclf));
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String inclf=args[i + 1];
      checkFilePattern(inclf);
      inclf=Util.normalizeDriveLetter(inclf);
      includefiles.add(fixupSeparator(inclf));
    }
    if (args[i].equals(option)) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str" + option);
      }
      String[] root_dirs=args[i + 1].split(File.pathSeparator);
      for (      String r : root_dirs) {
        File root=new File(r);
        if (!root.isDirectory()) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str");
        }
        try {
          root=root.getCanonicalFile();
        }
 catch (        IOException e) {
          throw new ProblemException("String_Node_Str" + e);
        }
        if (roots.contains(root)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option);
        }
        if (roots.equals(bin_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        if (roots.equals(gensrc_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        if (roots.equals(header_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        roots.add(root);
        Source.scanRoot(root,suffixes,excludes,includes,excludefiles,includefiles,found_files,found_modules,current_module,findBooleanOption(args,"String_Node_Str"),false,inLinksrc);
      }
    }
    if (args[i].equals("String_Node_Str") || args[i].equals("String_Node_Str") || args[i].equals("String_Node_Str")|| args[i].equals("String_Node_Str")|| args[i].equals("String_Node_Str")) {
      includes=new LinkedList<String>();
      excludes=new LinkedList<String>();
      excludefiles=new LinkedList<String>();
      includefiles=new LinkedList<String>();
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Scan the arguments for -i -x -xf -if followed by the option -src, -sourcepath, -modulepath or -classpath and produce a map of all the files to referenced for that particular option. Store the found sources and the found modules in the supplied maps.
 */
private boolean findFiles(String[] args,String option,Set<String> suffixes,Map<String,Source> found_files,Map<String,Module> found_modules,Module current_module,boolean inLinksrc) throws ProblemException, ProblemException {
  Set<File> roots=new HashSet<File>();
  List<String> includes=new LinkedList<String>();
  List<String> excludes=new LinkedList<String>();
  List<String> excludefiles=new LinkedList<String>();
  List<String> includefiles=new LinkedList<String>();
  List<String> moduleinfo=new LinkedList<String>();
  moduleinfo.add("String_Node_Str");
  for (int i=0; i < args.length; ++i) {
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String incl=args[i + 1];
      checkPattern(incl);
      includes.add(incl);
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String excl=args[i + 1];
      checkPattern(excl);
      excludes.add(excl);
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String exclf=args[i + 1];
      checkFilePattern(exclf);
      exclf=Util.normalizeDriveLetter(exclf);
      excludefiles.add(fixupSeparator(exclf));
    }
    if (args[i].equals("String_Node_Str")) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str");
      }
      String inclf=args[i + 1];
      checkFilePattern(inclf);
      inclf=Util.normalizeDriveLetter(inclf);
      includefiles.add(fixupSeparator(inclf));
    }
    if (args[i].equals(option)) {
      if (i + 1 >= args.length) {
        throw new ProblemException("String_Node_Str" + option);
      }
      String[] root_dirs=args[i + 1].split(File.pathSeparator);
      for (      String r : root_dirs) {
        File root=new File(r);
        if (!root.isDirectory()) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str");
        }
        try {
          root=root.getCanonicalFile();
        }
 catch (        IOException e) {
          throw new ProblemException("String_Node_Str" + e);
        }
        if (roots.contains(root)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option);
        }
        if (root.equals(bin_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        if (root.equals(gensrc_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        if (root.equals(header_dir)) {
          throw new ProblemException("String_Node_Str" + r + "String_Node_Str"+ option+ "String_Node_Str");
        }
        roots.add(root);
        Source.scanRoot(root,suffixes,excludes,includes,excludefiles,includefiles,found_files,found_modules,current_module,findBooleanOption(args,"String_Node_Str"),false,inLinksrc);
      }
    }
    if (args[i].equals("String_Node_Str") || args[i].equals("String_Node_Str") || args[i].equals("String_Node_Str")|| args[i].equals("String_Node_Str")|| args[i].equals("String_Node_Str")) {
      includes=new LinkedList<String>();
      excludes=new LinkedList<String>();
      excludefiles=new LinkedList<String>();
      includefiles=new LinkedList<String>();
    }
  }
  return true;
}