Program: 32897
Project: 32897
Buggy source:
public String displayCalibrationResult(Stream<Pair<Double,Integer>> stream){
  final int numBuckets=10;
  double bucketLength=1.0 / numBuckets;
  BucketInfo empty=new BucketInfo(numBuckets);
  BucketInfo total;
  total=stream.map(doubleIntegerPair -> {
    double probs=this.predict(doubleIntegerPair.getFirst());
    double[] sum=new double[numBuckets];
    double[] sumProbs=new double[numBuckets];
    double[] count=new double[numBuckets];
    int index=(int)Math.floor(probs / bucketLength);
    if (index < 0) {
      index=0;
    }
    if (index >= numBuckets) {
      index=numBuckets - 1;
    }
    count[index]+=1;
    sumProbs[index]+=probs;
    sum[index]+=doubleIntegerPair.getSecond();
    return new BucketInfo(count,sum,sumProbs);
  }
).reduce(empty,BucketInfo::add,BucketInfo::add);
  double[] counts=total.getCounts();
  double[] correct=total.getSums();
  double[] sumProbs=total.getSumProbs();
  double[] accs=new double[counts.length];
  double[] average_confidence=new double[counts.length];
  for (int i=0; i < counts.length; i++) {
    accs[i]=correct[i] / counts[i];
  }
  for (int j=0; j < counts.length; j++) {
    average_confidence[j]=sumProbs[j] / counts[j];
  }
  DecimalFormat decimalFormat=new DecimalFormat("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  for (int i=0; i < 10; i++) {
    sb.append("String_Node_Str").append(decimalFormat.format(i * 0.1)).append("String_Node_Str").append(decimalFormat.format((i + 1) * 0.1)).append("String_Node_Str").append("String_Node_Str").append(counts[i]).append("String_Node_Str").append(correct[i]).append("String_Node_Str").append(counts[i] - correct[i]).append("String_Node_Str").append(decimalFormat.format(accs[i])).append("String_Node_Str").append(decimalFormat.format(average_confidence[i])).append("String_Node_Str");
  }
  String result=sb.toString();
  return result;
}

Fixed version (ground truth):
public String displayCalibrationResult(Stream<Pair<Double,Integer>> stream){
  final int numBuckets=10;
  double bucketLength=1.0 / numBuckets;
  BucketInfo total;
  total=stream.map(doubleIntegerPair -> {
    double probs=this.predict(doubleIntegerPair.getFirst());
    double[] sum=new double[numBuckets];
    double[] sumProbs=new double[numBuckets];
    double[] count=new double[numBuckets];
    int index=(int)Math.floor(probs / bucketLength);
    if (index < 0) {
      index=0;
    }
    if (index >= numBuckets) {
      index=numBuckets - 1;
    }
    count[index]+=1;
    sumProbs[index]+=probs;
    sum[index]+=doubleIntegerPair.getSecond();
    return new BucketInfo(count,sum,sumProbs);
  }
).collect(() -> new BucketInfo(numBuckets),BucketInfo::addAll,BucketInfo::addAll);
  double[] counts=total.getCounts();
  double[] correct=total.getSums();
  double[] sumProbs=total.getSumProbs();
  double[] accs=new double[counts.length];
  double[] average_confidence=new double[counts.length];
  for (int i=0; i < counts.length; i++) {
    accs[i]=correct[i] / counts[i];
  }
  for (int j=0; j < counts.length; j++) {
    average_confidence[j]=sumProbs[j] / counts[j];
  }
  DecimalFormat decimalFormat=new DecimalFormat("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  for (int i=0; i < 10; i++) {
    sb.append("String_Node_Str").append(decimalFormat.format(i * 0.1)).append("String_Node_Str").append(decimalFormat.format((i + 1) * 0.1)).append("String_Node_Str").append("String_Node_Str").append(counts[i]).append("String_Node_Str").append(correct[i]).append("String_Node_Str").append(counts[i] - correct[i]).append("String_Node_Str").append(decimalFormat.format(accs[i])).append("String_Node_Str").append(decimalFormat.format(average_confidence[i])).append("String_Node_Str");
  }
  String result=sb.toString();
  return result;
}