Program: 125149
Project: 125149
Buggy source:
public Long WQWeightByTraversal(Tripartition trip,CondensedTraversalWeightCalculator algorithm){
  long t=System.nanoTime();
  long weight=0;
  long[] sx=new long[3], sxy=new long[3];
  int[] q;
  int[] from, to;
  BitSet[] b=new BitSet[]{trip.cluster1.getBitSet(),trip.cluster2.getBitSet(),trip.cluster3.getBitSet()};
  for (int i=0, i_end=GlobalMaps.taxonIdentifier.taxonCount(); i < i_end; i++) {
    overlap[i][0]=b[0].get(i) ? 1 : 0;
    overlap[i][1]=b[1].get(i) ? 1 : 0;
    overlap[i][2]=b[2].get(i) ? 1 : 0;
  }
  for (int i=GlobalMaps.taxonIdentifier.taxonCount(), i_end=overlap.length; i < i_end; i++) {
    overlap[i][0]=0;
    overlap[i][1]=0;
    overlap[i][2]=0;
  }
  time1+=System.nanoTime() - t;
  for (int i=0, i_end=dependerID.length; i < i_end; i++) {
    from=overlap[dependeeID[i]];
    to=overlap[dependerID[i]];
    if (dependingFactor[i] == 1) {
      from[0]+=to[0];
      from[1]+=to[1];
      from[2]+=to[2];
    }
 else {
      from[0]-=to[0];
      from[1]-=to[1];
      from[2]-=to[2];
    }
  }
  time2+=System.nanoTime() - t;
  for (int i=0, j=0, i_end=partitionMultiplicity.length; i < i_end; i++) {
    if (partitionNumClusters[i] == 3) {
      weight+=F(overlap[partitionClusterID[j]],overlap[partitionClusterID[j + 1]],overlap[partitionClusterID[j + 2]]) * partitionMultiplicity[i];
    }
 else {
      long tempWeight=0;
      sx[0]=0;
      sx[1]=0;
      sx[2]=0;
      sxy[0]=0;
      sxy[1]=0;
      sxy[2]=0;
      for (int p=j, p_end=j + partitionNumClusters[i]; p < p_end; p++) {
        q=overlap[partitionClusterID[p]];
        sx[0]+=q[0];
        sx[1]+=q[1];
        sx[2]+=q[2];
        sxy[0]+=q[1] * q[2];
        sxy[1]+=q[2] * q[0];
        sxy[2]+=q[0] * q[1];
      }
      for (int p=j, p_end=j + partitionNumClusters[i]; p < p_end; p++) {
        q=overlap[partitionClusterID[p]];
        tempWeight+=((sx[1] - q[1]) * (sx[2] - q[2]) - sxy[0] + q[1] * q[2]) * q[0] * (q[0] - 1L) + ((sx[2] - q[2]) * (sx[0] - q[0]) - sxy[1] + q[2] * q[0]) * q[1] * (q[1] - 1L) + ((sx[0] - q[0]) * (sx[1] - q[1]) - sxy[2] + q[0] * q[1]) * q[2] * (q[2] - 1L);
      }
      weight+=tempWeight * partitionMultiplicity[i];
    }
    j+=partitionNumClusters[i];
  }
  time+=System.nanoTime() - t;
  return weight;
}

Fixed version (ground truth):
public Long WQWeightByTraversal(Tripartition trip,CondensedTraversalWeightCalculator algorithm){
  long t=System.nanoTime();
  long weight=0;
  long[] sx=new long[3], sxy=new long[3];
  int[] q;
  int[] from, to;
  BitSet[] b=new BitSet[]{trip.cluster1.getBitSet(),trip.cluster2.getBitSet(),trip.cluster3.getBitSet()};
  for (int i=0, i_end=GlobalMaps.taxonIdentifier.taxonCount(); i < i_end; i++) {
    overlap[i][0]=b[0].get(i) ? 1 : 0;
    overlap[i][1]=b[1].get(i) ? 1 : 0;
    overlap[i][2]=b[2].get(i) ? 1 : 0;
  }
  for (int i=GlobalMaps.taxonIdentifier.taxonCount(), i_end=overlap.length; i < i_end; i++) {
    overlap[i][0]=0;
    overlap[i][1]=0;
    overlap[i][2]=0;
  }
  time1+=System.nanoTime() - t;
  for (int i=0, i_end=dependerID.length; i < i_end; i++) {
    from=overlap[dependeeID[i]];
    to=overlap[dependerID[i]];
    if (dependingFactor[i] == 1) {
      to[0]+=from[0];
      to[1]+=from[1];
      to[2]+=from[2];
    }
 else {
      to[0]-=from[0];
      to[1]-=from[1];
      to[2]-=from[2];
    }
  }
  time2+=System.nanoTime() - t;
  for (int i=0, j=0, i_end=partitionMultiplicity.length; i < i_end; i++) {
    if (partitionNumClusters[i] == 3) {
      weight+=F(overlap[partitionClusterID[j]],overlap[partitionClusterID[j + 1]],overlap[partitionClusterID[j + 2]]) * partitionMultiplicity[i];
    }
 else {
      long tempWeight=0;
      sx[0]=0;
      sx[1]=0;
      sx[2]=0;
      sxy[0]=0;
      sxy[1]=0;
      sxy[2]=0;
      for (int p=j, p_end=j + partitionNumClusters[i]; p < p_end; p++) {
        q=overlap[partitionClusterID[p]];
        sx[0]+=q[0];
        sx[1]+=q[1];
        sx[2]+=q[2];
        sxy[0]+=q[1] * q[2];
        sxy[1]+=q[2] * q[0];
        sxy[2]+=q[0] * q[1];
      }
      for (int p=j, p_end=j + partitionNumClusters[i]; p < p_end; p++) {
        q=overlap[partitionClusterID[p]];
        tempWeight+=((sx[1] - q[1]) * (sx[2] - q[2]) - sxy[0] + q[1] * q[2]) * q[0] * (q[0] - 1L) + ((sx[2] - q[2]) * (sx[0] - q[0]) - sxy[1] + q[2] * q[0]) * q[1] * (q[1] - 1L) + ((sx[0] - q[0]) * (sx[1] - q[1]) - sxy[2] + q[0] * q[1]) * q[2] * (q[2] - 1L);
      }
      weight+=tempWeight * partitionMultiplicity[i];
    }
    j+=partitionNumClusters[i];
  }
  time+=System.nanoTime() - t;
  return weight;
}