Program: 146529
Project: 146529
Buggy source:
public void RetrieveMissingAnchors(Map<String,SplitOutputHandle> splits,SAMRecordIterator samItr){
  if (!this.anchorlookup.isEmpty()) {
    int anchorcount=this.anchorlookup.keySet().stream().map((s) -> anchorlookup.get(s).keySet().size()).reduce(0,Integer::sum);
    System.err.println("String_Node_Str" + anchorcount + "String_Node_Str");
    Map<String,Boolean> anchorfound=new HashMap<>();
    for (    String s : anchorlookup.keySet()) {
      anchorfound.put(s,false);
    }
    while (samItr.hasNext()) {
      SAMRecord s;
      try {
        s=samItr.next();
      }
 catch (      SAMFormatException ex) {
        System.err.println(ex.getMessage());
        continue;
      }
      SAMReadGroupRecord r;
      if (this.checkRGs)       r=s.getReadGroup();
 else       r=new SAMReadGroupRecord(defId);
      String rg=r.getId();
      if (this.anchorlookup.containsKey(rg)) {
        if (s.getReadName().matches("String_Node_Str")) {
          String initread=s.getReadName().replaceAll("String_Node_Str","String_Node_Str");
          s.setReadName(initread);
        }
        String clone=rn.GetCloneName(s.getReadName(),s.getFlags());
        if (this.anchorlookup.get(rg).containsKey(clone)) {
          short num=rn.GetCloneNum(s.getReadName(),s.getFlags());
          if (this.anchorlookup.get(rg).get(clone) == num) {
            splits.get(rg).AddAnchor(s);
            anchorfound.put(clone,true);
          }
        }
      }
    }
    long found=anchorfound.keySet().stream().filter((e) -> anchorfound.get(e)).count();
    long notfound=(long)anchorfound.size() - found;
    System.err.println("String_Node_Str" + found + "String_Node_Str"+ notfound+ "String_Node_Str"+ anchorfound.size()+ "String_Node_Str");
  }
  samItr.close();
  splits.keySet().stream().forEach((s) -> splits.get(s).CloseAnchorHandle());
}

Fixed version (ground truth):
/** 
 * This is a recursive iteration over the bam file to grab anchor reads that were not associated with split reads the first time. Could be avoided if the 0x8 flag was set on the parent anchor read (you can pull them out in the first pass)
 * @param splits the temp split output handle
 * @param samItr a samjdk iterator over the input bam file.
 */
public void RetrieveMissingAnchors(Map<String,SplitOutputHandle> splits,SAMRecordIterator samItr){
  if (!this.anchorlookup.isEmpty()) {
    int anchorcount=this.anchorlookup.keySet().stream().map((s) -> anchorlookup.get(s).keySet().size()).reduce(0,Integer::sum);
    System.err.println("String_Node_Str" + anchorcount + "String_Node_Str");
    Map<String,Boolean> anchorfound=new HashMap<>();
    for (    String s : anchorlookup.keySet()) {
      anchorfound.put(s,false);
    }
    while (samItr.hasNext()) {
      SAMRecord s;
      try {
        s=samItr.next();
      }
 catch (      SAMFormatException ex) {
        System.err.println(ex.getMessage());
        continue;
      }
      SAMReadGroupRecord r;
      if (this.checkRGs)       r=s.getReadGroup();
 else       r=new SAMReadGroupRecord(defId);
      String rg=r.getId();
      if (this.anchorlookup.containsKey(rg)) {
        if (s.getReadName().matches("String_Node_Str")) {
          String initread=s.getReadName().replaceAll("String_Node_Str","String_Node_Str");
          s.setReadName(initread);
        }
        String clone=rn.GetCloneName(s.getReadName(),s.getFlags());
        if (this.anchorlookup.get(rg).containsKey(clone)) {
          short num=rn.GetCloneNum(s.getReadName(),s.getFlags());
          if (this.anchorlookup.get(rg).get(clone) == num) {
            splits.get(rg).AddAnchor(s);
            anchorfound.put(clone,true);
          }
        }
      }
    }
    long found=anchorfound.keySet().stream().filter((e) -> anchorfound.get(e)).count();
    long notfound=(long)anchorfound.size() - found;
    System.err.println("String_Node_Str" + found + "String_Node_Str"+ notfound+ "String_Node_Str"+ anchorfound.size()+ "String_Node_Str");
  }
  samItr.close();
  splits.keySet().stream().forEach((s) -> splits.get(s).CloseAnchorHandle());
}