Program: 146555
Project: 146555
Buggy source:
/** 
 * This function is designed to retrieve the metadata created by this class for use in subsequence paired end discordancy discovery
 * @param maxdist The maximum distance on the same chromosome to limit paired enddiscordant read detection
 * @return A map of the threshold values for each read group. Map Key: the read group. Value: an integer array where the first value is the lower threshold for read lengths (insertion detection) and the second value is the upper threshold for detection (deletion detection).
 */
public Map<String,Integer[]> getThresholds(int maxdist){
  Map<String,Integer[]> vs=new HashMap<>();
  this.insertSizes.keySet().stream().forEach((r) -> {
    int median=stats.MedianAbsoluteDeviation.Median(this.insertSizes.get(r));
    int mad=stats.MedianAbsoluteDeviation.MAD(this.insertSizes.get(r));
    List<Integer> filtered=this.insertSizes.get(r).stream().filter(s -> s < median + (mad * 20)).collect(Collectors.toList());
    long fvalues=this.insertSizes.get(r).parallelStream().filter(s -> s > median + (mad * 20)).count();
    if (fvalues > 0)     System.err.println("String_Node_Str" + fvalues + "String_Node_Str"+ median+ "String_Node_Str"+ mad+ "String_Node_Str"+ r);
    double avg=stats.StdevAvg.IntAvg(filtered);
    double stdev=stats.StdevAvg.stdevInt(avg,filtered);
    Double[] d={avg,stdev};
    this.values.put(r,d);
    int lower=(int)Math.round(avg - (3 * stdev));
    int upper=(int)Math.round(avg + (3 * stdev));
    if (lower < 0)     lower=0;
    Integer[] v={lower,upper,maxdist};
    vs.put(r,v);
  }
);
  return vs;
}

Fixed version (ground truth):
/** 
 * This function is designed to retrieve the metadata created by this class for use in subsequence paired end discordancy discovery
 * @param maxdist The maximum distance on the same chromosome to limit paired enddiscordant read detection
 * @return A map of the threshold values for each read group. Map Key: the read group. Value: an integer array where the first value is the lower threshold for read lengths (insertion detection) and the second value is the upper threshold for detection (deletion detection).
 */
public Map<String,Integer[]> getThresholds(int maxdist){
  Map<String,Integer[]> vs=new HashMap<>();
  this.insertSizes.keySet().stream().forEach((r) -> {
    int median=stats.MedianAbsoluteDeviation.Median(this.insertSizes.get(r));
    int mad=stats.MedianAbsoluteDeviation.MAD(this.insertSizes.get(r));
    List<Integer> filtered=this.insertSizes.get(r).stream().filter(s -> s < median + (mad * 20)).collect(Collectors.toList());
    long fvalues=this.insertSizes.get(r).parallelStream().filter(s -> s > median + (mad * 20)).count();
    if (fvalues > 0) {
      System.err.println("String_Node_Str" + fvalues + "String_Node_Str"+ median+ "String_Node_Str"+ mad+ "String_Node_Str"+ r);
      log.log(Level.INFO,"String_Node_Str" + fvalues + "String_Node_Str"+ median+ "String_Node_Str"+ mad+ "String_Node_Str"+ r);
    }
    double avg=stats.StdevAvg.IntAvg(filtered);
    double stdev=stats.StdevAvg.stdevInt(avg,filtered);
    Double[] d={avg,stdev};
    this.values.put(r,d);
    int lower=(int)Math.round(avg - (3 * stdev));
    int upper=(int)Math.round(avg + (3 * stdev));
    if (lower < 0)     lower=0;
    Integer[] v={lower,upper,maxdist};
    vs.put(r,v);
  }
);
  return vs;
}