Program: 36886
Project: 36886
Buggy source:
@Override protected void runImpl() throws ExecutionFailedException {
  if (maximalBadFrequency.get() != null && bottomCutPercent.get() != null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Timer t=new Timer();
  BigLong2ShortHashMap hm=IOUtils.loadKmers(inputFiles.get(),maximalBadFrequency.get(),availableProcessors.get(),logger);
  debug("String_Node_Str" + Misc.usedMemoryAsString() + "String_Node_Str"+ t);
  long totalKmers=0;
  int[] stat=new int[STAT_LEN];
  Iterator<MutableLongShortEntry> it=hm.entryIterator();
  while (it.hasNext()) {
    MutableLongShortEntry entry=it.next();
    int value=entry.getValue();
    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" + NumUtils.groupDigits(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 dir=outputDir.get();
  if (!dir.isDirectory()) {
    dir.mkdir();
  }
  String basename=FileUtils.removeExtension(inputFiles.get()[0].getName(),"String_Node_Str");
  String fp=dir + File.separator + basename;
  fp+=(inputFiles.get().length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
  File destination=new File(fp);
  outputFilePr.set(destination);
  Deque<Sequence> sequences;
  try {
    sequences=SequencesFinders.thresholdStrategy(hm,availableProcessors.get(),maximalBadFrequency.get(),sequenceLen.get(),k.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  info(NumUtils.groupDigits(sequences.size()) + "String_Node_Str");
  debug("String_Node_Str" + Misc.usedMemoryWithoutRunningGCAsString());
  try {
    Sequence.printSequences(sequences,destination);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  info("String_Node_Str" + destination);
}

Fixed version (ground truth):
@Override protected void runImpl() throws ExecutionFailedException {
  Timer t=new Timer();
  BigLong2ShortHashMap hm=IOUtils.loadKmers(inputFiles.get(),maximalBadFrequency.get(),availableProcessors.get(),logger);
  debug("String_Node_Str" + Misc.usedMemoryAsString() + "String_Node_Str"+ t);
  long totalKmers=0;
  int[] stat=new int[STAT_LEN];
  Iterator<MutableLongShortEntry> it=hm.entryIterator();
  while (it.hasNext()) {
    MutableLongShortEntry entry=it.next();
    int value=entry.getValue();
    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) {
    info("String_Node_Str" + bottomCutPercent.get());
    long kmersToCut=totalKmers * bottomCutPercent.get() / 100;
    debug("String_Node_Str" + NumUtils.groupDigits(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];
    }
  }
  info("String_Node_Str" + maximalBadFrequency.get());
  File dir=outputDir.get();
  if (!dir.isDirectory()) {
    dir.mkdir();
  }
  String basename=FileUtils.removeExtension(inputFiles.get()[0].getName(),"String_Node_Str");
  String fp=dir + File.separator + basename;
  fp+=(inputFiles.get().length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str";
  File destination=new File(fp);
  outputFilePr.set(destination);
  Deque<Sequence> sequences;
  try {
    sequences=SequencesFinders.thresholdStrategy(hm,availableProcessors.get(),maximalBadFrequency.get(),sequenceLen.get(),k.get());
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
    return;
  }
  info(NumUtils.groupDigits(sequences.size()) + "String_Node_Str");
  debug("String_Node_Str" + Misc.usedMemoryWithoutRunningGCAsString());
  try {
    Sequence.printSequences(sequences,destination);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  info("String_Node_Str" + destination);
}