Program: 64539
Project: 64539
Buggy source:
private void printData(String latexFile,int indicatorIndex,double[][][] centralTendency,double[][][] dispersion,String caption) throws IOException {
  FileWriter os=new FileWriter(latexFile,true);
  os.write("String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + configuration.getIndicatorList().get(indicatorIndex).getName() + "String_Node_Str"+ caption+ "String_Node_Str"+ "String_Node_Str");
  os.write("String_Node_Str" + configuration.getIndicatorList().get(indicatorIndex).getName() + "String_Node_Str"+ "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str");
  for (  TaggedAlgorithm algorithm : configuration.getAlgorithmList()) {
    os.write("String_Node_Str");
  }
  os.write("String_Node_Str");
  os.write("String_Node_Str");
  for (int i=-1; i < configuration.getAlgorithmList().size(); i++) {
    if (i == -1) {
      os.write("String_Node_Str");
    }
 else     if (i == (configuration.getAlgorithmList().size() - 1)) {
      os.write("String_Node_Str" + configuration.getAlgorithmList().get(i).getTag() + "String_Node_Str"+ "String_Node_Str");
    }
 else {
      os.write("String_Node_Str" + configuration.getAlgorithmList().get(i).getTag() + "String_Node_Str");
    }
  }
  os.write("String_Node_Str");
  for (int i=0; i < configuration.getProblemList().size(); i++) {
    double bestCentralTendencyValue;
    double bestDispersionValue;
    double secondBestCentralTendencyValue;
    double secondBestDispersionValue;
    int bestIndex=-1;
    int secondBestIndex=-1;
    if (configuration.getIndicatorList().get(indicatorIndex).isTheLowerTheIndicatorValueTheBetter()) {
      bestCentralTendencyValue=Double.MAX_VALUE;
      bestDispersionValue=Double.MAX_VALUE;
      secondBestCentralTendencyValue=Double.MAX_VALUE;
      secondBestDispersionValue=Double.MAX_VALUE;
      for (int j=0; j < (configuration.getAlgorithmList().size()); j++) {
        if ((centralTendency[indicatorIndex][i][j] < bestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == bestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < bestDispersionValue))) {
          secondBestIndex=bestIndex;
          secondBestCentralTendencyValue=bestCentralTendencyValue;
          secondBestDispersionValue=bestDispersionValue;
          bestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          bestDispersionValue=dispersion[indicatorIndex][i][j];
          bestIndex=j;
        }
 else         if ((centralTendency[indicatorIndex][i][j] < secondBestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == secondBestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < secondBestDispersionValue))) {
          secondBestIndex=j;
          secondBestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          secondBestDispersionValue=dispersion[indicatorIndex][i][j];
        }
      }
    }
 else {
      bestCentralTendencyValue=Double.MIN_VALUE;
      bestDispersionValue=Double.MIN_VALUE;
      secondBestCentralTendencyValue=Double.MIN_VALUE;
      secondBestDispersionValue=Double.MIN_VALUE;
      for (int j=0; j < (configuration.getAlgorithmList().size()); j++) {
        if ((centralTendency[indicatorIndex][i][j] > bestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == bestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < bestDispersionValue))) {
          secondBestIndex=bestIndex;
          secondBestCentralTendencyValue=bestCentralTendencyValue;
          secondBestDispersionValue=bestDispersionValue;
          bestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          bestDispersionValue=dispersion[indicatorIndex][i][j];
          bestIndex=j;
        }
 else         if ((centralTendency[indicatorIndex][i][j] > secondBestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == secondBestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < secondBestDispersionValue))) {
          secondBestIndex=j;
          secondBestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          secondBestDispersionValue=dispersion[indicatorIndex][i][j];
        }
      }
    }
    os.write(configuration.getProblemList().get(i).getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
    for (int j=0; j < (configuration.getAlgorithmList().size() - 1); j++) {
      if (j == bestIndex) {
        os.write("String_Node_Str");
      }
      if (j == secondBestIndex) {
        os.write("String_Node_Str");
      }
      String m=String.format(Locale.ENGLISH,"String_Node_Str",centralTendency[indicatorIndex][i][j]);
      String s=String.format(Locale.ENGLISH,"String_Node_Str",dispersion[indicatorIndex][i][j]);
      os.write("String_Node_Str" + m + "String_Node_Str"+ s+ "String_Node_Str");
    }
    if (bestIndex == (configuration.getAlgorithmList().size() - 1)) {
      os.write("String_Node_Str");
    }
    String m=String.format(Locale.ENGLISH,"String_Node_Str",centralTendency[indicatorIndex][i][configuration.getAlgorithmList().size() - 1]);
    String s=String.format(Locale.ENGLISH,"String_Node_Str",dispersion[indicatorIndex][i][configuration.getAlgorithmList().size() - 1]);
    os.write("String_Node_Str" + m + "String_Node_Str"+ s+ "String_Node_Str"+ "String_Node_Str");
  }
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.close();
}

Fixed version (ground truth):
private void printData(String latexFile,int indicatorIndex,double[][][] centralTendency,double[][][] dispersion,String caption) throws IOException {
  FileWriter os=new FileWriter(latexFile,true);
  os.write("String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + configuration.getIndicatorList().get(indicatorIndex).getName() + "String_Node_Str"+ caption+ "String_Node_Str"+ "String_Node_Str");
  os.write("String_Node_Str" + configuration.getIndicatorList().get(indicatorIndex).getName() + "String_Node_Str"+ "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str");
  for (  TaggedAlgorithm algorithm : configuration.getAlgorithmList()) {
    os.write("String_Node_Str");
  }
  os.write("String_Node_Str");
  os.write("String_Node_Str");
  for (int i=-1; i < configuration.getAlgorithmList().size(); i++) {
    if (i == -1) {
      os.write("String_Node_Str");
    }
 else     if (i == (configuration.getAlgorithmList().size() - 1)) {
      os.write("String_Node_Str" + configuration.getAlgorithmList().get(i).getTag() + "String_Node_Str"+ "String_Node_Str");
    }
 else {
      os.write("String_Node_Str" + configuration.getAlgorithmList().get(i).getTag() + "String_Node_Str");
    }
  }
  os.write("String_Node_Str");
  for (int i=0; i < configuration.getProblemList().size(); i++) {
    double bestCentralTendencyValue;
    double bestDispersionValue;
    double secondBestCentralTendencyValue;
    double secondBestDispersionValue;
    int bestIndex=-1;
    int secondBestIndex=-1;
    if (configuration.getIndicatorList().get(indicatorIndex).isTheLowerTheIndicatorValueTheBetter()) {
      bestCentralTendencyValue=Double.MAX_VALUE;
      bestDispersionValue=Double.MAX_VALUE;
      secondBestCentralTendencyValue=Double.MAX_VALUE;
      secondBestDispersionValue=Double.MAX_VALUE;
      for (int j=0; j < (configuration.getAlgorithmList().size()); j++) {
        if ((centralTendency[indicatorIndex][i][j] < bestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == bestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < bestDispersionValue))) {
          secondBestIndex=bestIndex;
          secondBestCentralTendencyValue=bestCentralTendencyValue;
          secondBestDispersionValue=bestDispersionValue;
          bestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          bestDispersionValue=dispersion[indicatorIndex][i][j];
          bestIndex=j;
        }
 else         if ((centralTendency[indicatorIndex][i][j] < secondBestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == secondBestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < secondBestDispersionValue))) {
          secondBestIndex=j;
          secondBestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          secondBestDispersionValue=dispersion[indicatorIndex][i][j];
        }
      }
    }
 else {
      bestCentralTendencyValue=Double.MIN_VALUE;
      bestDispersionValue=Double.MIN_VALUE;
      secondBestCentralTendencyValue=Double.MIN_VALUE;
      secondBestDispersionValue=Double.MIN_VALUE;
      for (int j=0; j < (configuration.getAlgorithmList().size()); j++) {
        if ((centralTendency[indicatorIndex][i][j] > bestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == bestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < bestDispersionValue))) {
          secondBestIndex=bestIndex;
          secondBestCentralTendencyValue=bestCentralTendencyValue;
          secondBestDispersionValue=bestDispersionValue;
          bestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          bestDispersionValue=dispersion[indicatorIndex][i][j];
          bestIndex=j;
        }
 else         if ((centralTendency[indicatorIndex][i][j] > secondBestCentralTendencyValue) || ((centralTendency[indicatorIndex][i][j] == secondBestCentralTendencyValue) && (dispersion[indicatorIndex][i][j] < secondBestDispersionValue))) {
          secondBestIndex=j;
          secondBestCentralTendencyValue=centralTendency[indicatorIndex][i][j];
          secondBestDispersionValue=dispersion[indicatorIndex][i][j];
        }
      }
    }
    os.write(configuration.getProblemList().get(i).getName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
    for (int j=0; j < (configuration.getAlgorithmList().size() - 1); j++) {
      if (j == bestIndex) {
        os.write("String_Node_Str");
      }
      if (j == secondBestIndex) {
        os.write("String_Node_Str");
      }
      String m=String.format(Locale.ENGLISH,"String_Node_Str",centralTendency[indicatorIndex][i][j]);
      String s=String.format(Locale.ENGLISH,"String_Node_Str",dispersion[indicatorIndex][i][j]);
      os.write("String_Node_Str" + m + "String_Node_Str"+ s+ "String_Node_Str");
    }
    if (bestIndex == (configuration.getAlgorithmList().size() - 1)) {
      os.write("String_Node_Str");
    }
    if (secondBestIndex == (configuration.getAlgorithmList().size() - 1)) {
      os.write("String_Node_Str");
    }
    String m=String.format(Locale.ENGLISH,"String_Node_Str",centralTendency[indicatorIndex][i][configuration.getAlgorithmList().size() - 1]);
    String s=String.format(Locale.ENGLISH,"String_Node_Str",dispersion[indicatorIndex][i][configuration.getAlgorithmList().size() - 1]);
    os.write("String_Node_Str" + m + "String_Node_Str"+ s+ "String_Node_Str"+ "String_Node_Str");
  }
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.write("String_Node_Str" + "String_Node_Str");
  os.close();
}