Program: 33026
Project: 33026
Buggy source:
static void test(Config config) throws Exception {
  String output=config.getString("String_Node_Str");
  String modelName=config.getString("String_Node_Str");
  HMLGradientBoosting boosting=HMLGradientBoosting.deserialize(new File(output,modelName));
  MultiLabelClfDataSet dataSet=loadTestData(config);
  System.out.println("String_Node_Str" + Accuracy.accuracy(boosting,dataSet));
  System.out.println("String_Node_Str" + Overlap.overlap(boosting,dataSet));
  if (config.getBoolean("String_Node_Str")) {
    int limit=config.getInt("String_Node_Str");
    List<MultiLabelPredictionAnalysis> analysisList=IntStream.range(0,dataSet.getNumDataPoints()).parallel().filter(i -> {
      MultiLabel multiLabel=dataSet.getMultiLabels()[i];
      MultiLabel prediction=boosting.predict(dataSet.getRow(i));
      boolean accept=false;
      if (config.getBoolean("String_Node_Str")) {
        accept=accept || multiLabel.equals(prediction);
      }
      if (config.getBoolean("String_Node_Str")) {
        accept=accept || !multiLabel.equals(prediction);
      }
      return accept;
    }
).mapToObj(i -> {
      MultiLabel multiLabel=dataSet.getMultiLabels()[i];
      MultiLabel prediction=boosting.predict(dataSet.getRow(i));
      List<Integer> classes=new ArrayList<Integer>();
      for (int k=0; k < dataSet.getNumClasses(); k++) {
        boolean condition1=multiLabel.matchClass(k) && prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition2=!multiLabel.matchClass(k) && !prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition3=!multiLabel.matchClass(k) && prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition4=multiLabel.matchClass(k) && !prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition5=k < boosting.getNumClasses();
        boolean accept=(condition1 || condition2 || condition3|| condition4) && condition5;
        if (accept) {
          classes.add(k);
        }
      }
      return HMLGBInspector.analyzePrediction(boosting,dataSet,i,classes,limit);
    }
).collect(Collectors.toList());
    int numDocsPerFile=config.getInt("String_Node_Str");
    int numFiles=(int)Math.ceil((double)analysisList.size() / numDocsPerFile);
    for (int i=0; i < numFiles; i++) {
      int start=i;
      int end=i + numDocsPerFile;
      List<MultiLabelPredictionAnalysis> partition=new ArrayList<>();
      for (int a=start; a < end; a++) {
        partition.add(analysisList.get(a));
      }
      ObjectMapper mapper=new ObjectMapper();
      String fileName=config.getString("String_Node_Str");
      int suffixIndex=fileName.lastIndexOf("String_Node_Str");
      if (suffixIndex == -1) {
        suffixIndex=fileName.length();
      }
      String file=fileName.substring(0,suffixIndex) + "String_Node_Str" + (i + 1)+ "String_Node_Str";
      mapper.writeValue(new File(config.getString("String_Node_Str"),file),partition);
    }
  }
}

Fixed version (ground truth):
static void test(Config config) throws Exception {
  String output=config.getString("String_Node_Str");
  String modelName=config.getString("String_Node_Str");
  HMLGradientBoosting boosting=HMLGradientBoosting.deserialize(new File(output,modelName));
  MultiLabelClfDataSet dataSet=loadTestData(config);
  System.out.println("String_Node_Str" + Accuracy.accuracy(boosting,dataSet));
  System.out.println("String_Node_Str" + Overlap.overlap(boosting,dataSet));
  if (config.getBoolean("String_Node_Str")) {
    int limit=config.getInt("String_Node_Str");
    List<MultiLabelPredictionAnalysis> analysisList=IntStream.range(0,dataSet.getNumDataPoints()).parallel().filter(i -> {
      MultiLabel multiLabel=dataSet.getMultiLabels()[i];
      MultiLabel prediction=boosting.predict(dataSet.getRow(i));
      boolean accept=false;
      if (config.getBoolean("String_Node_Str")) {
        accept=accept || multiLabel.equals(prediction);
      }
      if (config.getBoolean("String_Node_Str")) {
        accept=accept || !multiLabel.equals(prediction);
      }
      return accept;
    }
).mapToObj(i -> {
      MultiLabel multiLabel=dataSet.getMultiLabels()[i];
      MultiLabel prediction=boosting.predict(dataSet.getRow(i));
      List<Integer> classes=new ArrayList<Integer>();
      for (int k=0; k < dataSet.getNumClasses(); k++) {
        boolean condition1=multiLabel.matchClass(k) && prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition2=!multiLabel.matchClass(k) && !prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition3=!multiLabel.matchClass(k) && prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition4=multiLabel.matchClass(k) && !prediction.matchClass(k) && config.getBoolean("String_Node_Str");
        boolean condition5=k < boosting.getNumClasses();
        boolean accept=(condition1 || condition2 || condition3|| condition4) && condition5;
        if (accept) {
          classes.add(k);
        }
      }
      return HMLGBInspector.analyzePrediction(boosting,dataSet,i,classes,limit);
    }
).collect(Collectors.toList());
    int numDocsPerFile=config.getInt("String_Node_Str");
    int numFiles=(int)Math.ceil((double)analysisList.size() / numDocsPerFile);
    for (int i=0; i < numFiles; i++) {
      int start=i;
      int end=i + numDocsPerFile;
      List<MultiLabelPredictionAnalysis> partition=new ArrayList<>();
      for (int a=start; a < end && a < analysisList.size(); a++) {
        partition.add(analysisList.get(a));
      }
      ObjectMapper mapper=new ObjectMapper();
      String fileName=config.getString("String_Node_Str");
      int suffixIndex=fileName.lastIndexOf("String_Node_Str");
      if (suffixIndex == -1) {
        suffixIndex=fileName.length();
      }
      String file=fileName.substring(0,suffixIndex) + "String_Node_Str" + (i + 1)+ "String_Node_Str";
      mapper.writeValue(new File(config.getString("String_Node_Str"),file),partition);
    }
  }
}