Program: 74988
Project: 74988
Buggy source:
public static void proc(final String inputSuffix,final String outputFilename,String root,String currentDir) throws Exception {
  File dir=new File(currentDir);
  FileFilter filterForDirs=new FileFilter(){
    public boolean accept(    File file){
      return file.isDirectory();
    }
  }
;
  File[] children=dir.listFiles(filterForDirs);
  for (int i=0; i < children.length; i++) {
    proc(inputSuffix,outputFilename,root,children[i].toString());
  }
  FilenameFilter filterForOutputFilename=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.equals(outputFilename);
    }
  }
;
  ArrayList indexFiles=new ArrayList();
  for (int i=0; i < children.length; i++) {
    File[] grandchildren=children[i].listFiles(filterForOutputFilename);
    if (grandchildren.length == 1) {
      String indexFile=grandchildren[0].toString();
      indexFile=indexFile.replaceFirst("String_Node_Str" + currentDir,"String_Node_Str");
      indexFile=indexFile.replaceFirst("String_Node_Str" + File.separator,"String_Node_Str");
      indexFiles.add(indexFile);
    }
 else {
      if (grandchildren.length > 1) {
        throw new Exception("String_Node_Str" + outputFilename + "String_Node_Str"+ children[i]);
      }
    }
  }
  FilenameFilter filterForInputSuffix=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith(inputSuffix) && !name.equals(outputFilename);
    }
  }
;
  String[] ncFiles=dir.list(filterForInputSuffix);
  String[] components={};
  if (ncFiles.length > 0) {
    components=new String[ncFiles.length];
    for (int i=0; i < ncFiles.length; i++) {
      String shortpath=currentDir.replaceFirst("String_Node_Str" + root,"String_Node_Str");
      shortpath=shortpath.replaceFirst("String_Node_Str" + File.separator,"String_Node_Str");
      shortpath=shortpath + File.separator + ncFiles[i];
      shortpath=shortpath.replaceFirst(inputSuffix + "String_Node_Str","String_Node_Str");
      components[i]=shortpath;
    }
  }
  String[] currentDirSubnames=currentDir.split(File.separator);
  if (currentDirSubnames.length < 1)   throw new Exception("String_Node_Str" + currentDir);
  String libraryName=currentDirSubnames[currentDirSubnames.length - 1];
  String fullOutputFilename=currentDir + File.separator + outputFilename;
  String[] stringArrayType={};
  MoMLLib.generateIndex(components,(String[])indexFiles.toArray(stringArrayType),libraryName,fullOutputFilename);
}

Fixed version (ground truth):
public static void proc(final String inputSuffix,final String outputFilename,String root,String currentDir) throws Exception {
  File dir=new File(currentDir);
  FileFilter filterForDirs=new FileFilter(){
    public boolean accept(    File file){
      return file.isDirectory();
    }
  }
;
  File[] children=dir.listFiles(filterForDirs);
  for (int i=0; i < children.length; i++) {
    proc(inputSuffix,outputFilename,root,children[i].toString());
  }
  FilenameFilter filterForOutputFilename=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.equals(outputFilename);
    }
  }
;
  ArrayList indexFiles=new ArrayList();
  for (int i=0; i < children.length; i++) {
    File[] grandchildren=children[i].listFiles(filterForOutputFilename);
    if (grandchildren.length == 1) {
      String indexFile=grandchildren[0].toString();
      indexFile=indexFile.replaceFirst("String_Node_Str" + currentDir,"String_Node_Str");
      indexFile=indexFile.replaceFirst("String_Node_Str" + File.separator,"String_Node_Str");
      indexFiles.add(indexFile);
    }
 else {
      if (grandchildren.length > 1) {
        throw new Exception("String_Node_Str" + outputFilename + "String_Node_Str"+ children[i]);
      }
    }
  }
  FilenameFilter filterForInputSuffix=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith(inputSuffix) && !name.equals(outputFilename);
    }
  }
;
  try {
    String[] ncFiles=dir.list(filterForInputSuffix);
    String[] components={};
    if (ncFiles.length > 0) {
      components=new String[ncFiles.length];
      for (int i=0; i < ncFiles.length; i++) {
        String shortpath=currentDir.replaceFirst("String_Node_Str" + root,"String_Node_Str");
        shortpath=shortpath.replaceFirst("String_Node_Str" + File.separator,"String_Node_Str");
        shortpath=shortpath + File.separator + ncFiles[i];
        shortpath=shortpath.replaceFirst(inputSuffix + "String_Node_Str","String_Node_Str");
        components[i]=shortpath;
      }
    }
    String[] currentDirSubnames=currentDir.split(File.separator);
    if (currentDirSubnames.length < 1)     throw new Exception("String_Node_Str" + currentDir);
    String libraryName=currentDirSubnames[currentDirSubnames.length - 1];
    String fullOutputFilename=currentDir + File.separator + outputFilename;
    String[] stringArrayType={};
    MoMLLib.generateIndex(components,(String[])indexFiles.toArray(stringArrayType),libraryName,fullOutputFilename);
  }
 catch (  PatternSyntaxException e) {
    System.err.println("String_Node_Str" + e);
    e.printStackTrace();
  }
}