Program: 36892
Project: 36892
Buggy source:
@Override protected void runImpl() throws ExecutionFailedException {
  if (maximalBadFrequency.get() != null && bottomCutPercent.get() != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayLong2IntHashMap hm;
  try {
    hm=IOUtils.loadKmers(inputFiles.get(),0,availableProcessors.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  debug(hm.size() + "String_Node_Str");
  long totalKmers=0;
  int[] stat=new int[STAT_LEN];
  for (int i=0; i < hm.hm.length; ++i) {
    for (    int value : hm.hm[i].values()) {
      totalKmers+=value;
      if (value >= stat.length) {
        value=stat.length - 1;
      }
      ++stat[value];
    }
  }
  try {
    dumpStat(stat,workDir + File.separator + DISTIBUTION_FILENAME);
  }
 catch (  FileNotFoundException e) {
    throw new ExecutionFailedException(e);
  }
  if (bottomCutPercent.get() != null) {
    long kmersToCut=totalKmers * bottomCutPercent.get() / 100;
    debug("String_Node_Str" + kmersToCut);
    long currentKmersCount=0;
    for (int i=0; i < stat.length - 1; i++) {
      if (currentKmersCount >= kmersToCut) {
        maximalBadFrequency.set(i);
        break;
      }
      currentKmersCount+=(long)i * stat[i];
    }
  }
  if (maximalBadFrequency.get() == null) {
    int threshold=1;
    long currentSum=0;
    while (stat[threshold] * (long)threshold > stat[threshold + 1] * (long)(threshold + 1)) {
      currentSum+=stat[threshold];
      if (currentSum * 2 > totalKmers) {
        debug("String_Node_Str");
        break;
      }
      threshold++;
    }
    maximalBadFrequency.set(threshold);
  }
  info("String_Node_Str" + maximalBadFrequency.get());
  File destination=outputFile.get();
  if (destination == null) {
    File dir=new File(workDir + File.separator + "String_Node_Str");
    if (!dir.isDirectory()) {
      dir.mkdir();
    }
    String basename=inputFiles.get()[0].getName().replace("String_Node_Str","String_Node_Str");
    String fp=dir + File.separator + basename;
    fp+=(inputFiles.get().length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
    destination=new File(fp);
  }
  List<Sequence> sequences;
  try {
    sequences=SequencesFinders.thresholdStrategy(hm,availableProcessors.get(),maximalBadFrequency.get(),sequenceLen.get(),k.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  info("String_Node_Str" + sequences.size());
  try {
    Sequence.printSequences(sequences,destination);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  info("String_Node_Str" + destination);
}

Fixed version (ground truth):
@Override protected void runImpl() throws ExecutionFailedException {
  if (maximalBadFrequency.get() != null && bottomCutPercent.get() != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayLong2IntHashMap hm;
  try {
    hm=IOUtils.loadKmers(inputFiles.get(),0,availableProcessors.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  debug(hm.size() + "String_Node_Str");
  long totalKmers=0;
  int[] stat=new int[STAT_LEN];
  for (int i=0; i < hm.hm.length; ++i) {
    for (    int value : hm.hm[i].values()) {
      totalKmers+=value;
      if (value >= stat.length) {
        value=stat.length - 1;
      }
      ++stat[value];
    }
  }
  try {
    dumpStat(stat,workDir + File.separator + DISTRIBUTION_FILENAME);
  }
 catch (  FileNotFoundException e) {
    throw new ExecutionFailedException(e);
  }
  if (bottomCutPercent.get() != null) {
    long kmersToCut=totalKmers * bottomCutPercent.get() / 100;
    debug("String_Node_Str" + kmersToCut);
    long currentKmersCount=0;
    for (int i=0; i < stat.length - 1; i++) {
      if (currentKmersCount >= kmersToCut) {
        maximalBadFrequency.set(i);
        break;
      }
      currentKmersCount+=(long)i * stat[i];
    }
  }
  if (maximalBadFrequency.get() == null) {
    int threshold=1;
    long currentSum=0;
    while (stat[threshold] * (long)threshold > stat[threshold + 1] * (long)(threshold + 1)) {
      currentSum+=stat[threshold];
      if (currentSum * 2 > totalKmers) {
        debug("String_Node_Str");
        break;
      }
      threshold++;
    }
    maximalBadFrequency.set(threshold);
  }
  info("String_Node_Str" + maximalBadFrequency.get());
  File destination=outputFile.get();
  if (destination == null) {
    File dir=new File(workDir + File.separator + "String_Node_Str");
    if (!dir.isDirectory()) {
      dir.mkdir();
    }
    String basename=inputFiles.get()[0].getName().replace("String_Node_Str","String_Node_Str");
    String fp=dir + File.separator + basename;
    fp+=(inputFiles.get().length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
    destination=new File(fp);
  }
  List<Sequence> sequences;
  try {
    sequences=SequencesFinders.thresholdStrategy(hm,availableProcessors.get(),maximalBadFrequency.get(),sequenceLen.get(),k.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  info("String_Node_Str" + sequences.size());
  try {
    Sequence.printSequences(sequences,destination);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
  info("String_Node_Str" + destination);
}