Program: 169225
Project: 169225
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");
  HashMap<SequenceId,HitCounter> bestSequenceHit=new HashMap<SequenceId,HitCounter>(this.numberSequencesMinHashed.intValue() / 5 + 1);
  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) {
        HitCounter currentHitInfo=bestSequenceHit.get(sequenceId);
        if (currentHitInfo == null) {
          currentHitInfo=new HitCounter(1);
          bestSequenceHit.put(sequenceId,currentHitInfo);
        }
 else         currentHitInfo.addHit();
      }
    }
    hashIndex++;
  }
  long minHashEndTime=System.nanoTime();
  this.minhashSearchTime.getAndAdd(minHashEndTime - startTime);
  this.numberSequencesHit.getAndAdd(bestSequenceHit.size());
  this.numberSubSequencesHit.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;
      boolean accept;
      if (seqHashes.useAlignment()) {
        result=seqHashes.getAlignmentSequence().getOverlapInfo(this.aligner,matchedHashes.getAlignmentSequence());
        accept=result.rawScore > 0.01;
      }
 else {
        result=seqHashes.getOrderedHashes().getOverlapInfo(matchedHashes.getOrderedHashes(),this.maxShift);
        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");
  HashMap<SequenceId,HitCounter> bestSequenceHit=new HashMap<SequenceId,HitCounter>(this.numberSequencesMinHashed.intValue() / 5 + 1);
  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) {
        HitCounter currentHitInfo=bestSequenceHit.get(sequenceId);
        if (currentHitInfo == null) {
          currentHitInfo=new HitCounter(1);
          bestSequenceHit.put(sequenceId,currentHitInfo);
        }
 else         currentHitInfo.addHit();
      }
    }
    hashIndex++;
  }
  long minHashEndTime=System.nanoTime();
  this.minhashSearchTime.getAndAdd(minHashEndTime - startTime);
  this.numberSequencesHit.getAndAdd(bestSequenceHit.size());
  this.numberSubSequencesHit.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;
      boolean accept;
      if (seqHashes.useAlignment()) {
        result=seqHashes.getAlignmentSequence().getOverlapInfo(this.aligner,matchedHashes.getAlignmentSequence());
        accept=result.rawScore > 0.0;
      }
 else {
        result=seqHashes.getOrderedHashes().getOverlapInfo(matchedHashes.getOrderedHashes(),this.maxShift);
        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;
}