Program: 169217
Project: 169217
Buggy source:
@Override public List<MatchResult> findMatches(SequenceSketch seqHashes,boolean toSelf){
  long startTime=System.nanoTime();
  MinHashSketch minHash=seqHashes.getMinHashes();
  if (this.hashes.size() != minHash.numHashes())   throw new MhapRuntimeException("String_Node_Str" + this.hashes.size() + "String_Node_Str"+ minHash.numHashes()+ "String_Node_Str");
  long numLookups=this.getNumberSequencesSearched();
  long numProcessed=this.numberElementsProcessed.get();
  int mapSize=Math.max(256,(int)(4.0 * (double)numLookups / (double)numProcessed));
  Map<SequenceId,HitCounter> bestSequenceHit=new Object2ObjectOpenHashMap<>(mapSize);
  int[] minHashes=minHash.getMinHashArray();
  int hashIndex=0;
  for (  Map<Integer,ArrayList<SequenceId>> currHash : this.hashes) {
    ArrayList<SequenceId> currentHashMatchList=currHash.get(minHashes[hashIndex]);
    if (currentHashMatchList != null) {
      this.numberElementsProcessed.getAndAdd(currentHashMatchList.size());
      for (      SequenceId sequenceId : currentHashMatchList) {
        bestSequenceHit.compute(sequenceId,(k,v) -> (v == null) ? new HitCounter(1) : v.addHit());
      }
    }
    hashIndex++;
  }
  long minHashEndTime=System.nanoTime();
  this.minhashSearchTime.getAndAdd(minHashEndTime - startTime);
  this.numberSequencesHit.getAndAdd(bestSequenceHit.size());
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>(32);
  for (  Entry<SequenceId,HitCounter> match : bestSequenceHit.entrySet()) {
    SequenceId matchId=match.getKey();
    if (toSelf && matchId.getHeaderId() == seqHashes.getSequenceId().getHeaderId())     continue;
    if (match.getValue().count >= this.numMinMatches) {
      SequenceSketch matchedHashes=this.sequenceVectorsHash.get(match.getKey());
      if (matchedHashes == null)       throw new MhapRuntimeException("String_Node_Str");
      if (matchedHashes.getSequenceLength() < this.minStoreLength && seqHashes.getSequenceLength() < this.minStoreLength)       continue;
      if (toSelf && matchId.getHeaderId() > seqHashes.getSequenceId().getHeaderId() && matchedHashes.getSequenceLength() >= this.minStoreLength && seqHashes.getSequenceLength() >= this.minStoreLength)       continue;
      if (toSelf && matchedHashes.getSequenceLength() < this.minStoreLength && seqHashes.getSequenceLength() >= this.minStoreLength)       continue;
      OverlapInfo result=seqHashes.getOrderedHashes().getOverlapInfo(matchedHashes.getOrderedHashes(),this.maxShift);
      boolean accept=result.score >= this.acceptScore;
      this.numberSequencesFullyCompared.getAndIncrement();
      if (accept) {
        MatchResult currResult=new MatchResult(seqHashes.getSequenceId(),matchId,result,seqHashes.getSequenceLength(),matchedHashes.getSequenceLength());
        matches.add(currResult);
      }
    }
  }
  long endTime=System.nanoTime();
  this.sortMergeSearchTime.getAndAdd(endTime - minHashEndTime);
  return matches;
}

Fixed version (ground truth):
@Override public List<MatchResult> findMatches(SequenceSketch seqHashes,boolean toSelf){
  long startTime=System.nanoTime();
  MinHashSketch minHash=seqHashes.getMinHashes();
  if (this.hashes.size() != minHash.numHashes())   throw new MhapRuntimeException("String_Node_Str" + this.hashes.size() + "String_Node_Str"+ minHash.numHashes()+ "String_Node_Str");
  long numLookups=this.getNumberSequencesSearched();
  long numProcessed=this.numberElementsProcessed.get();
  int mapSize=Math.max(256,(int)(4.0 * (double)numProcessed / (double)numLookups));
  Map<SequenceId,HitCounter> bestSequenceHit=new Object2ObjectOpenHashMap<>(mapSize);
  int[] minHashes=minHash.getMinHashArray();
  int hashIndex=0;
  long additionalProcessed=0L;
  for (  Map<Integer,ArrayList<SequenceId>> currHash : this.hashes) {
    ArrayList<SequenceId> currentHashMatchList=currHash.get(minHashes[hashIndex]);
    if (currentHashMatchList != null) {
      additionalProcessed+=currentHashMatchList.size();
      for (      SequenceId sequenceId : currentHashMatchList) {
        bestSequenceHit.compute(sequenceId,(k,v) -> (v == null) ? new HitCounter(1) : v.addHit());
      }
    }
    hashIndex++;
  }
  long minHashEndTime=System.nanoTime();
  this.minhashSearchTime.getAndAdd(minHashEndTime - startTime);
  this.numberElementsProcessed.getAndAdd(additionalProcessed);
  this.numberSequencesHit.getAndAdd(bestSequenceHit.size());
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>(32);
  for (  Entry<SequenceId,HitCounter> match : bestSequenceHit.entrySet()) {
    SequenceId matchId=match.getKey();
    if (toSelf && matchId.getHeaderId() == seqHashes.getSequenceId().getHeaderId())     continue;
    if (match.getValue().count >= this.numMinMatches) {
      SequenceSketch matchedHashes=this.sequenceVectorsHash.get(match.getKey());
      if (matchedHashes == null)       throw new MhapRuntimeException("String_Node_Str");
      if (matchedHashes.getSequenceLength() < this.minStoreLength && seqHashes.getSequenceLength() < this.minStoreLength)       continue;
      if (toSelf && matchId.getHeaderId() > seqHashes.getSequenceId().getHeaderId() && matchedHashes.getSequenceLength() >= this.minStoreLength && seqHashes.getSequenceLength() >= this.minStoreLength)       continue;
      if (toSelf && matchedHashes.getSequenceLength() < this.minStoreLength && seqHashes.getSequenceLength() >= this.minStoreLength)       continue;
      OverlapInfo result=seqHashes.getOrderedHashes().getOverlapInfo(matchedHashes.getOrderedHashes(),this.maxShift);
      boolean accept=result.score >= this.acceptScore;
      this.numberSequencesFullyCompared.getAndIncrement();
      if (accept) {
        MatchResult currResult=new MatchResult(seqHashes.getSequenceId(),matchId,result,seqHashes.getSequenceLength(),matchedHashes.getSequenceLength());
        matches.add(currResult);
      }
    }
  }
  long endTime=System.nanoTime();
  this.sortMergeSearchTime.getAndAdd(endTime - minHashEndTime);
  return matches;
}