Program: 58372
Project: 58372
Buggy source:
public void write(File file) throws IOException {
  String outStream;
  int i, j;
  try (FileOutputStream fos=new FileOutputStream(file)){
    outStream="String_Node_Str";
    outStream+="String_Node_Str";
    if (symbol_text.length() == 0) {
      outStream+="String_Node_Str";
    }
 else {
      outStream+="String_Node_Str" + symbol_text + "String_Node_Str";
    }
    outStream+="String_Node_Str";
    outStream+="String_Node_Str" + symbol_width + "String_Node_Str"+ symbol_height+ "String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
    outStream+=String.format("String_Node_Str",bgRed) + "String_Node_Str" + String.format("String_Node_Str",bgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",bgBlue)+ "String_Node_Str";
    outStream+=symbol_height + "String_Node_Str" + symbol_width+ "String_Node_Str";
    for (i=0; i < rectangle.size(); i++) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
        outStream+=rectangle.get(i).height + "String_Node_Str" + (symbol_height - rectangle.get(i).y)+ "String_Node_Str"+ rectangle.get(i).x+ "String_Node_Str"+ rectangle.get(i).width+ "String_Node_Str";
      }
 else {
        if ((rectangle.get(i).height != rectangle.get(i - 1).height) || (rectangle.get(i).y != rectangle.get(i - 1).y)) {
          outStream+="String_Node_Str";
          outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
          outStream+=rectangle.get(i).height + "String_Node_Str" + (symbol_height - rectangle.get(i).y)+ "String_Node_Str";
        }
        outStream+="String_Node_Str" + rectangle.get(i).x + "String_Node_Str"+ rectangle.get(i).width+ "String_Node_Str";
      }
    }
    for (i=0; i < textbox.size(); i++) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
      }
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str" + String.format("String_Node_Str",textbox.get(i).x) + "String_Node_Str"+ String.format("String_Node_Str",symbol_height - textbox.get(i).y)+ "String_Node_Str";
      outStream+="String_Node_Str" + textbox.get(i).text + "String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str" + textbox.get(i).text + "String_Node_Str";
      outStream+="String_Node_Str";
    }
    for (i=0; i < ellipse.size(); i+=2) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
      }
      outStream+=String.format("String_Node_Str",symbol_height - ellipse.get(i).x + (ellipse.get(i).width / 2)) + "String_Node_Str" + String.format("String_Node_Str",ellipse.get(i).y + (ellipse.get(i).width / 2))+ "String_Node_Str"+ String.format("String_Node_Str",ellipse.get(i).width / 2)+ "String_Node_Str"+ String.format("String_Node_Str",ellipse.get(i + 1).x + (ellipse.get(i + 1).width / 2))+ "String_Node_Str"+ String.format("String_Node_Str",symbol_height - ellipse.get(i + 1).y + (ellipse.get(i + 1).width / 2))+ "String_Node_Str"+ String.format("String_Node_Str",ellipse.get(i + 1).width / 2)+ "String_Node_Str";
    }
    for (i=0; i < hexagon.size(); i++) {
      for (j=0; j < 6; j++) {
        outStream+=String.format("String_Node_Str",hexagon.get(i).pointX[j]) + "String_Node_Str" + String.format("String_Node_Str",symbol_height - hexagon.get(i).pointY[j])+ "String_Node_Str";
      }
      outStream+="String_Node_Str";
    }
    outStream+="String_Node_Str";
    for (i=0; i < outStream.length(); i++) {
      fos.write(outStream.charAt(i));
    }
  }
 }

Fixed version (ground truth):
public void write(File file) throws IOException {
  String outStream;
  int i, j;
  try (FileOutputStream fos=new FileOutputStream(file)){
    outStream="String_Node_Str";
    outStream+="String_Node_Str";
    if (symbol_text.length() == 0) {
      outStream+="String_Node_Str";
    }
 else {
      outStream+="String_Node_Str" + symbol_text + "String_Node_Str";
    }
    outStream+="String_Node_Str";
    outStream+="String_Node_Str" + symbol_width + "String_Node_Str"+ symbol_height+ "String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+="String_Node_Str";
    outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
    outStream+=String.format("String_Node_Str",bgRed) + "String_Node_Str" + String.format("String_Node_Str",bgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",bgBlue)+ "String_Node_Str";
    outStream+=symbol_height + "String_Node_Str" + symbol_width+ "String_Node_Str";
    for (i=0; i < rectangle.size(); i++) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
        outStream+=rectangle.get(i).height + "String_Node_Str" + (symbol_height - rectangle.get(i).y - rectangle.get(i).height)+ "String_Node_Str"+ rectangle.get(i).x+ "String_Node_Str"+ rectangle.get(i).width+ "String_Node_Str";
      }
 else {
        if ((rectangle.get(i).height != rectangle.get(i - 1).height) || (rectangle.get(i).y != rectangle.get(i - 1).y)) {
          outStream+="String_Node_Str";
          outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
          outStream+=rectangle.get(i).height + "String_Node_Str" + (symbol_height - rectangle.get(i).y - rectangle.get(i).height)+ "String_Node_Str";
        }
        outStream+="String_Node_Str" + rectangle.get(i).x + "String_Node_Str"+ rectangle.get(i).width+ "String_Node_Str";
      }
    }
    for (i=0; i < textbox.size(); i++) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
      }
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str" + String.format("String_Node_Str",textbox.get(i).x) + "String_Node_Str"+ String.format("String_Node_Str",symbol_height - textbox.get(i).y)+ "String_Node_Str";
      outStream+="String_Node_Str" + textbox.get(i).text + "String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str";
      outStream+="String_Node_Str" + textbox.get(i).text + "String_Node_Str";
      outStream+="String_Node_Str";
    }
    for (i=0; i < ellipse.size(); i+=2) {
      if (i == 0) {
        outStream+="String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
        outStream+=String.format("String_Node_Str",fgRed) + "String_Node_Str" + String.format("String_Node_Str",fgGreen)+ "String_Node_Str"+ String.format("String_Node_Str",fgBlue)+ "String_Node_Str";
      }
      double x_position_1, x_position_2;
      double y_position_1, y_position_2;
      double radius_1, radius_2;
      x_position_1=ellipse.get(i).x + (ellipse.get(i).width / 2);
      x_position_2=ellipse.get(i + 1).x + (ellipse.get(i + 1).width / 2);
      y_position_1=symbol_height - ellipse.get(i).y - (ellipse.get(i).width / 2);
      y_position_2=symbol_height - ellipse.get(i + 1).y - (ellipse.get(i + 1).width / 2);
      radius_1=ellipse.get(i).width / 2;
      radius_2=ellipse.get(i + 1).width / 2;
      outStream+=String.format("String_Node_Str",x_position_1) + "String_Node_Str" + String.format("String_Node_Str",y_position_1)+ "String_Node_Str"+ String.format("String_Node_Str",radius_1)+ "String_Node_Str"+ String.format("String_Node_Str",x_position_2)+ "String_Node_Str"+ String.format("String_Node_Str",y_position_2)+ "String_Node_Str"+ String.format("String_Node_Str",radius_2)+ "String_Node_Str"+ String.format("String_Node_Str",x_position_2 + radius_2)+ "String_Node_Str"+ String.format("String_Node_Str",y_position_2)+ "String_Node_Str";
    }
    for (i=0; i < hexagon.size(); i++) {
      for (j=0; j < 6; j++) {
        outStream+=String.format("String_Node_Str",hexagon.get(i).pointX[j]) + "String_Node_Str" + String.format("String_Node_Str",(symbol_height - hexagon.get(i).pointY[j]))+ "String_Node_Str";
      }
      outStream+="String_Node_Str";
    }
    outStream+="String_Node_Str";
    for (i=0; i < outStream.length(); i++) {
      fos.write(outStream.charAt(i));
    }
  }
 }