Program: 140875
Project: 140875
Buggy source:
private static String[] rankAndChoose(File freqQueries,File input,File output,Integer minNodes) throws IOException {
  FileInputStream fis=null;
  BufferedReader br=null;
  output.createNewFile();
  PrintWriter pw=new PrintWriter(output);
  String line;
  String[] feat=LogSolution.getFeatures();
  Integer[] momFreq=new Integer[feat.length];
  String[] momQueries=new String[feat.length];
  try {
    fis=new FileInputStream(input);
    br=new BufferedReader(new InputStreamReader(fis,Charset.forName("String_Node_Str")));
    while ((line=br.readLine()) != null) {
      String[] cluster=line.split("String_Node_Str")[1].replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str");
      if (cluster.length < minNodes) {
        continue;
      }
      Integer freq=LogSolution.getFreqSum(cluster,freqQueries);
      cluster=queryIDListToQueries(clusterToID(cluster),freqQueries);
      for (int i=0; i < feat.length; i++) {
        if (momFreq[i] >= freq) {
          continue;
        }
        for (int j=0; j < cluster.length; j++) {
          if (cluster[j].replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").contains(feat[i])) {
            momFreq[i]=freq;
            momQueries[i]=cluster[j];
            break;
          }
        }
      }
    }
    int k;
    for (k=0; k < momQueries.length - 1; k++) {
      pw.println(momQueries[k]);
    }
    pw.print(momQueries[k + 1]);
    pw.close();
  }
 catch (  IOException e) {
    LogHandler.writeStackTrace(log,e,Level.SEVERE);
  }
 finally {
    try {
      fis.close();
      br.close();
    }
 catch (    IOException e) {
      LogHandler.writeStackTrace(log,e,Level.SEVERE);
    }
  }
  return momQueries;
}

Fixed version (ground truth):
private static String[] rankAndChoose(File freqQueries,File input,File output,Integer minNodes) throws IOException {
  FileInputStream fis=null;
  BufferedReader br=null;
  output.createNewFile();
  PrintWriter pw=new PrintWriter(output);
  String line;
  String[] feat=LogSolution.getFeatures();
  Integer[] momFreq=new Integer[feat.length];
  for (int i=0; i < feat.length; i++) {
    momFreq[i]=0;
  }
  String[] momQueries=new String[feat.length];
  try {
    fis=new FileInputStream(input);
    br=new BufferedReader(new InputStreamReader(fis,Charset.forName("String_Node_Str")));
    while ((line=br.readLine()) != null) {
      if (line.isEmpty()) {
        continue;
      }
      String[] cluster=line.split("String_Node_Str")[1].replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str");
      if (cluster.length < minNodes) {
        continue;
      }
      Integer freq=LogSolution.getFreqSum(cluster,freqQueries);
      cluster=queryIDListToQueries(clusterToID(cluster),freqQueries);
      for (int i=0; i < feat.length; i++) {
        if (momFreq[i] >= freq) {
          continue;
        }
        for (int j=0; j < cluster.length; j++) {
          try {
            if (cluster[j] == null) {
              continue;
            }
            if (cluster[j].replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").contains(feat[i])) {
              momFreq[i]=freq;
              momQueries[i]=cluster[j];
              break;
            }
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
      }
    }
    int k;
    for (k=0; k < momQueries.length - 1; k++) {
      if (momQueries[k] != null) {
        pw.println(momQueries[k]);
      }
 else {
        log.info("String_Node_Str" + feat[k]);
      }
    }
    pw.print(momQueries[k]);
    pw.close();
  }
 catch (  IOException e) {
    LogHandler.writeStackTrace(log,e,Level.SEVERE);
  }
 finally {
    try {
      fis.close();
      br.close();
    }
 catch (    IOException e) {
      LogHandler.writeStackTrace(log,e,Level.SEVERE);
    }
  }
  return momQueries;
}