Program: 50417
Project: 50417
Buggy source:
public void processPositions(int referenceIndex,int position,ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo> list){
  int sumVariantCounts=0;
  for (int sampleIndex=0; sampleIndex < numberOfSamples; sampleIndex++) {
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_A_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_T_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_C_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_G_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_OTHER_INDEX]=0;
    sampleCounts[sampleIndex].referenceBase='?';
    sampleCounts[sampleIndex].distinctReadIndices.clear();
    sampleCounts[sampleIndex].sampleIndex=sampleIndex;
    sampleCounts[sampleIndex].varCount=0;
    sampleCounts[sampleIndex].refCount=0;
  }
  if (list != null) {
    IntSet distinctReadIndices=new IntArraySet();
    char refBase=setReferenceAllele(list);
    for (    edu.cornell.med.icb.goby.alignments.PositionBaseInfo info : list) {
      final int sampleIndex=info.readerIndex;
      distinctReadIndices.add(info.readIndex);
      if (info.matchesReference) {
        sampleCounts[sampleIndex].referenceBase=info.from;
        sampleCounts[sampleIndex].refCount++;
        incrementBaseCounter(info.from,sampleIndex);
      }
 else {
        sampleCounts[sampleIndex].varCount++;
        sumVariantCounts++;
        sampleCounts[sampleIndex].referenceBase=refBase;
        sampleCounts[sampleIndex].distinctReadIndices.add(info.readIndex);
        incrementBaseCounter(info.to,sampleIndex);
      }
    }
    if (distinctReadIndices.size() >= thresholdDistinctReadIndices && sumVariantCounts > minimumVariationSupport) {
      int groupIndexA=0;
      int groupIndexB=1;
      if (!isWithinStartFlap(referenceIndex,position)) {
        if (baseFilters.length != 0) {
          ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo> filteredList=new ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo>();
          for (          BaseFilter filter : baseFilters) {
            filter.filterBases(list,sampleCounts,filteredList);
          }
          CountFixer fixer=new CountFixer();
          fixer.fix(list,sampleCounts,filteredList);
        }
      }
      format.writeRecord(this,sampleCounts,referenceIndex,position,list,groupIndexA,groupIndexB);
    }
  }
}

Fixed version (ground truth):
public void processPositions(int referenceIndex,int position,ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo> list){
  int sumVariantCounts=0;
  for (int sampleIndex=0; sampleIndex < numberOfSamples; sampleIndex++) {
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_A_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_T_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_C_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_G_INDEX]=0;
    sampleCounts[sampleIndex].counts[SampleCountInfo.BASE_OTHER_INDEX]=0;
    sampleCounts[sampleIndex].referenceBase='?';
    sampleCounts[sampleIndex].distinctReadIndices.clear();
    sampleCounts[sampleIndex].sampleIndex=sampleIndex;
    sampleCounts[sampleIndex].varCount=0;
    sampleCounts[sampleIndex].refCount=0;
    sampleCounts[sampleIndex].failedCount=0;
  }
  if (list != null) {
    IntSet distinctReadIndices=new IntArraySet();
    char refBase=setReferenceAllele(list);
    for (    edu.cornell.med.icb.goby.alignments.PositionBaseInfo info : list) {
      final int sampleIndex=info.readerIndex;
      distinctReadIndices.add(info.readIndex);
      if (info.matchesReference) {
        sampleCounts[sampleIndex].referenceBase=info.from;
        sampleCounts[sampleIndex].refCount++;
        incrementBaseCounter(info.from,sampleIndex);
      }
 else {
        sampleCounts[sampleIndex].varCount++;
        sumVariantCounts++;
        sampleCounts[sampleIndex].referenceBase=refBase;
        sampleCounts[sampleIndex].distinctReadIndices.add(info.readIndex);
        incrementBaseCounter(info.to,sampleIndex);
      }
    }
    if (distinctReadIndices.size() >= thresholdDistinctReadIndices && sumVariantCounts > minimumVariationSupport) {
      int groupIndexA=0;
      int groupIndexB=1;
      if (!isWithinStartFlap(referenceIndex,position)) {
        if (baseFilters.length != 0) {
          ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo> filteredList=new ObjectArrayList<edu.cornell.med.icb.goby.alignments.PositionBaseInfo>();
          for (          BaseFilter filter : baseFilters) {
            filter.filterBases(list,sampleCounts,filteredList);
          }
          CountFixer fixer=new CountFixer();
          fixer.fix(list,sampleCounts,filteredList);
        }
      }
      format.writeRecord(this,sampleCounts,referenceIndex,position,list,groupIndexA,groupIndexB);
    }
  }
}