Program: 169233
Project: 169233
Buggy source:
private final static int[] computeNgramMinHashesWeighted(String seq,final int nGramSize,final int numHashes,FrequencyCounts kmerFilter,double repeatWeight){
  final int numberNGrams=seq.length() - nGramSize + 1;
  if (numberNGrams < 1)   throw new SketchRuntimeException("String_Node_Str");
  final long[] kmerHashes=HashUtils.computeSequenceHashesLong(seq,nGramSize,0);
  Long2ObjectLinkedOpenHashMap<HitCounter> hitMap=new Long2ObjectLinkedOpenHashMap<HitCounter>(kmerHashes.length);
  int maxCount=0;
  for (  long kmer : kmerHashes) {
    HitCounter counter=hitMap.get(kmer);
    if (counter == null) {
      counter=new HitCounter(1);
      hitMap.put(kmer,counter);
    }
 else     counter.addHit();
    if (maxCount < counter.count)     maxCount=counter.count;
  }
  int[] hashes=new int[Math.max(1,numHashes)];
  long[] best=new long[numHashes];
  Arrays.fill(best,Long.MAX_VALUE);
  for (  Entry<Long,HitCounter> kmer : hitMap.entrySet()) {
    long key=kmer.getKey();
    int weight=kmer.getValue().count;
    if (repeatWeight < 0.0) {
      weight=1;
      if (kmerFilter != null && kmerFilter.contains(key))       weight=0;
    }
 else     if (kmerFilter != null) {
      if (repeatWeight > 0.0 && repeatWeight < 1.0) {
        double td=(double)weight;
        double idf=kmerFilter.scaledIdf(key,REPEAT_SCALE);
        weight=(int)Math.round(td * idf);
        if (weight < 1)         weight=1;
      }
 else       if (repeatWeight >= 1.0) {
        if (kmerFilter.contains(key))         weight=0;
      }
    }
    if (weight <= 0)     continue;
    long x=key;
    for (int word=0; word < numHashes; word++) {
      for (int count=0; count < weight; count++) {
        x^=(x << 21);
        x^=(x >>> 35);
        x^=(x << 4);
        if (x < best[word]) {
          best[word]=x;
          if (word % 2 == 0)           hashes[word]=(int)key;
 else           hashes[word]=(int)(key >>> 32);
        }
      }
    }
  }
  return hashes;
}

Fixed version (ground truth):
private final static int[] computeNgramMinHashesWeighted(String seq,final int nGramSize,final int numHashes,FrequencyCounts kmerFilter,double repeatWeight){
  final int numberNGrams=seq.length() - nGramSize + 1;
  if (numberNGrams < 1)   throw new SketchRuntimeException("String_Node_Str");
  final long[] kmerHashes=HashUtils.computeSequenceHashesLong(seq,nGramSize,0);
  Long2ObjectLinkedOpenHashMap<HitCounter> hitMap=new Long2ObjectLinkedOpenHashMap<HitCounter>(kmerHashes.length);
  int maxCount=0;
  for (  long kmer : kmerHashes) {
    HitCounter counter=hitMap.get(kmer);
    if (counter == null) {
      counter=new HitCounter(1);
      hitMap.put(kmer,counter);
    }
 else     counter.addHit();
    if (maxCount < counter.count)     maxCount=counter.count;
  }
  int[] hashes=new int[Math.max(1,numHashes)];
  long[] best=new long[numHashes];
  Arrays.fill(best,Long.MAX_VALUE);
  for (  Entry<Long,HitCounter> kmer : hitMap.entrySet()) {
    long key=kmer.getKey();
    int weight=kmer.getValue().count;
    if (repeatWeight < 0.0) {
      weight=1;
      if (kmerFilter != null && kmerFilter.contains(key))       weight=0;
    }
 else     if (kmerFilter != null) {
      if (repeatWeight >= 0.0 && repeatWeight < 1.0) {
        double td=(double)weight;
        double idf=kmerFilter.scaledIdf(key,REPEAT_SCALE);
        weight=(int)Math.round(td * idf);
        if (weight < 1)         weight=1;
      }
 else       if (repeatWeight >= 1.0) {
        if (kmerFilter.contains(key))         weight=0;
      }
    }
    if (weight <= 0)     continue;
    long x=key;
    for (int word=0; word < numHashes; word++) {
      for (int count=0; count < weight; count++) {
        x^=(x << 21);
        x^=(x >>> 35);
        x^=(x << 4);
        if (x < best[word]) {
          best[word]=x;
          if (word % 2 == 0)           hashes[word]=(int)key;
 else           hashes[word]=(int)(key >>> 32);
        }
      }
    }
  }
  return hashes;
}