Program: 146532
Project: 146532
Buggy source:
public void bufferedAdd(SAMRecord a){
  String rname=a.getReadName();
  int rgflags=a.getFlags();
  if (((rgflags & 0x4) == 0x4 && (rgflags & 0x8) == 0x8))   return;
  if ((rgflags & 0x100) == 0x100)   return;
  SAMReadGroupRecord r;
  if (this.checkRGs)   r=a.getReadGroup();
 else   r=new SAMReadGroupRecord(defId);
  Integer[] t=this.thresholds.get(r.getId());
  int insert=Math.abs(a.getInferredInsertSize());
  int softclips=0;
  if (a.getCigarString().contains("String_Node_Str"))   softclips=this.getCigarSoftClips(a.getCigar());
  double softthresh=(double)a.getReadLength() * 0.20d;
  boolean properMDist=false;
  boolean properOrient=true;
  if ((rgflags & 0x1) == 0x1)   if (insert > t[0] && insert < t[1] && softclips < softthresh)   properMDist=true;
  if ((rgflags & 0x2) != 0x2)   properOrient=false;
  if (properMDist && properOrient)   return;
  if (a.getReadName().matches("String_Node_Str")) {
    String initread=a.getReadName().replaceAll("String_Node_Str","String_Node_Str");
    a.setReadName(initread);
  }
  String clone=rn.GetCloneName(a.getReadName(),a.getFlags());
  short num=rn.GetCloneNum(a.getReadName(),a.getFlags());
  long rnHash=rn.ReadHash(clone);
  long bin=readNameHashBin(rnHash);
  if (!SamTemp.containsKey(r.getId()))   SamTemp.put(r.getId(),new ConcurrentHashMap<>());
  if (!SamTemp.get(r.getId()).containsKey(bin))   SamTemp.get(r.getId()).put(bin,new SamOutputHandle(this.threshold,r.getId(),this.tempOutBase));
  SamTemp.get(r.getId()).get(bin).bufferedAdd(a,rnHash,num);
}

Fixed version (ground truth):
/** 
 * Buffered method for adding SAMRecords for processing. Will spill to disk automatically when threshold is reached.
 * @param a a SAMRecord object
 */
public void bufferedAdd(SAMRecord a){
  String rname=a.getReadName();
  int rgflags=a.getFlags();
  if (((rgflags & 0x4) == 0x4 && (rgflags & 0x8) == 0x8))   return;
  if ((rgflags & 0x100) == 0x100)   return;
  SAMReadGroupRecord r;
  if (this.checkRGs)   r=a.getReadGroup();
 else   r=new SAMReadGroupRecord(defId);
  Integer[] t=this.thresholds.get(r.getId());
  int insert=Math.abs(a.getInferredInsertSize());
  int softclips=0;
  if (a.getCigarString().contains("String_Node_Str"))   softclips=this.getCigarSoftClips(a.getCigar());
  double softthresh=(double)a.getReadLength() * 0.20d;
  boolean properMDist=false;
  boolean properOrient=true;
  if ((rgflags & 0x1) == 0x1)   if (insert > t[0] && insert < t[1] && softclips < softthresh)   properMDist=true;
  if ((rgflags & 0x2) != 0x2)   properOrient=false;
  if (properMDist && properOrient)   return;
  if (a.getReadName().matches("String_Node_Str")) {
    String initread=a.getReadName().replaceAll("String_Node_Str","String_Node_Str");
    a.setReadName(initread);
  }
  String clone=rn.GetCloneName(a.getReadName(),a.getFlags());
  short num=rn.GetCloneNum(a.getReadName(),a.getFlags());
  long rnHash=rn.ReadHash(clone);
  long bin=readNameHashBin(rnHash);
  if (!SamTemp.containsKey(r.getId()))   SamTemp.put(r.getId(),new ConcurrentHashMap<>());
  if (!SamTemp.get(r.getId()).containsKey(bin))   SamTemp.get(r.getId()).put(bin,new SamOutputHandle(this.threshold,r.getId(),this.tempOutBase));
  SamTemp.get(r.getId()).get(bin).bufferedAdd(a,rnHash,num);
}