Program: 13413
Project: 13413
Buggy source:
public static Map<String,LogInstance> summarize(String[] args) throws FileNotFoundException, IOException {
  PrintStream out=System.out;
  Properties props=new Properties();
  FileInputStream fis=new FileInputStream(new File("String_Node_Str"));
  try {
    props.load(fis);
  }
  finally {
    fis.close();
  }
  List<String> tsPatterns=new ArrayList<String>();
  List<String> dfPatterns=new ArrayList<String>();
  List<String> propKeys=new ArrayList<String>();
  Enumeration<String> keys=(Enumeration<String>)props.propertyNames();
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    propKeys.add(key);
  }
  Collections.sort(propKeys,new DigitComparator(END_DIGITS,false));
  for (  String key : propKeys) {
    if (key.startsWith("String_Node_Str") && !key.endsWith("String_Node_Str")) {
      tsPatterns.add(props.getProperty(key));
      String df=props.getProperty(key + "String_Node_Str");
      dfPatterns.add(df);
    }
  }
  out.println("String_Node_Str" + tsPatterns);
  out.println("String_Node_Str" + dfPatterns);
  out.println();
  Pattern[] patterns=new Pattern[tsPatterns.size()];
  for (int i=0; i < patterns.length; i++) {
    patterns[i]=Pattern.compile(tsPatterns.get(i),Pattern.DOTALL);
  }
  List<String> textAspects=new ArrayList<String>();
  for (int i=1; i < args.length; i++) {
    if (args[i].equals("String_Node_Str")) {
      outputDir=args[++i];
      out.println("String_Node_Str" + outputDir);
    }
 else {
      out.println("String_Node_Str" + args[i]);
      textAspects.add(args[i]);
    }
  }
  long timeStart=new Date().getTime();
  List<File> files=new ArrayList<File>();
  File file=new File(args[0]);
  String matchText=null;
  File srcDir;
  if (file.getName().contains("String_Node_Str") || file.isFile()) {
    matchText=file.getName().replaceAll("String_Node_Str","String_Node_Str");
    srcDir=file.getParentFile();
  }
 else {
    srcDir=file;
  }
  out.println("String_Node_Str" + srcDir);
  if (matchText != null) {
    out.println("String_Node_Str" + matchText);
  }
  out.println();
  getFiles(files,srcDir,matchText);
  Pattern pattern=DIGITS;
  for (  File f : files) {
    Matcher m=END_DIGITS.matcher(f.getName());
    if (m.matches()) {
      pattern=END_DIGITS;
      break;
    }
  }
  final Pattern digitPattern=pattern;
  Collections.sort(files,new DigitComparator(digitPattern,true));
  Map<String,LogInstance> logInstances=new HashMap<String,LogInstance>();
  if (outputDir != null) {
    createDir(outputDir);
  }
  long totalBytes=0;
  Map<String,LogInstance> hostToLogInstance=new LinkedHashMap<>();
  for (  File f : files) {
    String k;
    Matcher m=END_DIGITS2.matcher(f.getName());
    if (m.matches()) {
      k=m.group(1);
    }
 else {
      k=f.getName();
    }
    LogInstance logInstance=logInstances.get(k);
    if (logInstance == null) {
      String intanceOutputDir=null;
      if (outputDir != null) {
        intanceOutputDir=outputDir + File.separator + k;
        createDir(intanceOutputDir);
      }
      List<Aspect> aspects=new ArrayList<Aspect>();
      for (      String aspect : textAspects) {
        aspects.add(new TextMatchAspect(aspect,intanceOutputDir));
      }
      aspects.add(new OpenSearcherAspect());
      aspects.add(new CommitAspect());
      aspects.add(new QueryAspect(intanceOutputDir));
      aspects.add(new ErrorAspect(intanceOutputDir));
      logInstance=new LogInstance(aspects);
      hostToLogInstance.put(k,logInstance);
      logInstances.put(k,logInstance);
    }
    logInstance.track(f);
    totalBytes+=f.length();
    processFile(f,logInstance.getAspects(),patterns,dfPatterns.toArray(new String[0]),out);
  }
  long timeEnd=new Date().getTime();
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  out.println();
  out.println("String_Node_Str" + df.format((timeEnd - timeStart) / 1000.0 / 60.0) + "String_Node_Str"+ df.format(totalBytes / 1024.0 / 1024.0)+ "String_Node_Str"+ df.format(totalBytes / (float)files.size() / 1024.0/ 1024.0)+ "String_Node_Str");
  out.println();
  StringBuilder summary=new StringBuilder();
  summary.append("String_Node_Str");
  for (  Entry<String,LogInstance> liEntry : logInstances.entrySet()) {
    summary.append("String_Node_Str" + liEntry.getKey() + "String_Node_Str");
    for (    Aspect aspect : liEntry.getValue().getAspects()) {
      summary.append("String_Node_Str" + aspect.getSummaryLine());
    }
    summary.append("String_Node_Str");
  }
  out.print(summary + "String_Node_Str");
  if (outputDir != null) {
    PrintStream summaryOut=new PrintStream(new BufferedOutputStream(new FileOutputStream(outputDir + File.separator + "String_Node_Str")));
    summaryOut.print(summary);
    summaryOut.close();
  }
  for (  Entry<String,LogInstance> liEntry : logInstances.entrySet()) {
    PrintStream entryOut=out;
    if (outputDir != null) {
      entryOut=new PrintStream(new BufferedOutputStream(new FileOutputStream(outputDir + File.separator + liEntry.getKey()+ File.separator+ REPORT_FILENAME)));
    }
    entryOut.println("String_Node_Str" + liEntry.getKey());
    for (    Aspect aspect : liEntry.getValue().getAspects()) {
      entryOut.print("String_Node_Str" + aspect.getSummaryLine());
    }
    liEntry.getValue().printResults(entryOut);
    if (outputDir != null) {
      entryOut.close();
    }
    liEntry.getValue().close();
  }
  return hostToLogInstance;
}

Fixed version (ground truth):
public static Map<String,LogInstance> summarize(String[] args) throws FileNotFoundException, IOException {
  PrintStream out=System.out;
  Properties props=new Properties();
  FileInputStream fis=new FileInputStream(new File("String_Node_Str"));
  try {
    props.load(fis);
  }
  finally {
    fis.close();
  }
  List<String> tsPatterns=new ArrayList<String>();
  List<String> dfPatterns=new ArrayList<String>();
  List<String> propKeys=new ArrayList<String>();
  Enumeration<String> keys=(Enumeration<String>)props.propertyNames();
  while (keys.hasMoreElements()) {
    String key=keys.nextElement();
    propKeys.add(key);
  }
  Collections.sort(propKeys,new DigitComparator(END_DIGITS,false));
  for (  String key : propKeys) {
    if (key.startsWith("String_Node_Str") && !key.endsWith("String_Node_Str")) {
      tsPatterns.add(props.getProperty(key));
      String df=props.getProperty(key + "String_Node_Str");
      dfPatterns.add(df);
    }
  }
  out.println("String_Node_Str" + tsPatterns);
  out.println("String_Node_Str" + dfPatterns);
  out.println();
  Pattern[] patterns=new Pattern[tsPatterns.size()];
  for (int i=0; i < patterns.length; i++) {
    patterns[i]=Pattern.compile(tsPatterns.get(i),Pattern.DOTALL);
  }
  List<String> textAspects=new ArrayList<String>();
  for (int i=1; i < args.length; i++) {
    if (args[i].equals("String_Node_Str")) {
      outputDir=args[++i];
      out.println("String_Node_Str" + outputDir);
    }
 else {
      out.println("String_Node_Str" + args[i]);
      textAspects.add(args[i]);
    }
  }
  long timeStart=new Date().getTime();
  List<File> files=new ArrayList<File>();
  File file=new File(args[0]);
  String matchText=null;
  File srcDir;
  if (file.getName().contains("String_Node_Str") || file.isFile()) {
    matchText=file.getName().replaceAll("String_Node_Str","String_Node_Str");
    srcDir=file.getParentFile();
  }
 else {
    srcDir=file;
  }
  out.println("String_Node_Str" + srcDir);
  if (matchText != null) {
    out.println("String_Node_Str" + matchText);
  }
  out.println();
  getFiles(files,srcDir,matchText);
  Pattern pattern=DIGITS;
  for (  File f : files) {
    Matcher m=END_DIGITS.matcher(f.getName());
    if (m.matches()) {
      pattern=END_DIGITS;
      break;
    }
  }
  final Pattern digitPattern=pattern;
  Collections.sort(files,new DigitComparator(digitPattern,true));
  Map<String,LogInstance> logInstances=new HashMap<String,LogInstance>();
  if (outputDir != null) {
    createDir(outputDir);
  }
  long totalBytes=0;
  Map<String,LogInstance> hostToLogInstance=new LinkedHashMap<>();
  for (  File f : files) {
    String k;
    Matcher m=END_DIGITS2.matcher(f.getName());
    if (m.matches()) {
      k=m.group(1);
    }
 else {
      k=f.getName();
    }
    LogInstance logInstance=logInstances.get(k);
    if (logInstance == null) {
      String intanceOutputDir=null;
      if (outputDir != null) {
        intanceOutputDir=outputDir + File.separator + k;
        createDir(intanceOutputDir);
      }
      List<Aspect> aspects=new ArrayList<Aspect>();
      aspects.add(new OpenSearcherAspect());
      aspects.add(new CommitAspect());
      aspects.add(new QueryAspect(intanceOutputDir));
      aspects.add(new ErrorAspect(intanceOutputDir));
      for (      String aspect : textAspects) {
        aspects.add(new TextMatchAspect(aspect,intanceOutputDir));
      }
      logInstance=new LogInstance(aspects);
      hostToLogInstance.put(k,logInstance);
      logInstances.put(k,logInstance);
    }
    logInstance.track(f);
    totalBytes+=f.length();
    processFile(f,logInstance.getAspects(),patterns,dfPatterns.toArray(new String[0]),out);
  }
  long timeEnd=new Date().getTime();
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  out.println();
  out.println("String_Node_Str" + df.format((timeEnd - timeStart) / 1000.0 / 60.0) + "String_Node_Str"+ df.format(totalBytes / 1024.0 / 1024.0)+ "String_Node_Str"+ df.format(totalBytes / (float)files.size() / 1024.0/ 1024.0)+ "String_Node_Str");
  out.println();
  StringBuilder summary=new StringBuilder();
  summary.append("String_Node_Str");
  for (  Entry<String,LogInstance> liEntry : logInstances.entrySet()) {
    summary.append("String_Node_Str" + liEntry.getKey() + "String_Node_Str");
    for (    Aspect aspect : liEntry.getValue().getAspects()) {
      summary.append("String_Node_Str" + aspect.getSummaryLine());
    }
    summary.append("String_Node_Str");
  }
  out.print(summary + "String_Node_Str");
  if (outputDir != null) {
    PrintStream summaryOut=new PrintStream(new BufferedOutputStream(new FileOutputStream(outputDir + File.separator + "String_Node_Str")));
    summaryOut.print(summary);
    summaryOut.close();
  }
  for (  Entry<String,LogInstance> liEntry : logInstances.entrySet()) {
    PrintStream entryOut=out;
    if (outputDir != null) {
      entryOut=new PrintStream(new BufferedOutputStream(new FileOutputStream(outputDir + File.separator + liEntry.getKey()+ File.separator+ REPORT_FILENAME)));
    }
    entryOut.println("String_Node_Str" + liEntry.getKey());
    for (    Aspect aspect : liEntry.getValue().getAspects()) {
      entryOut.print("String_Node_Str" + aspect.getSummaryLine());
    }
    liEntry.getValue().printResults(entryOut);
    if (outputDir != null) {
      entryOut.close();
    }
    liEntry.getValue().close();
  }
  return hostToLogInstance;
}