Program: 19790
Project: 19790
Buggy source:
/** 
 * Saves the current configuration to the given file
 * @param file place to save the configuration
 * @throws IOException if an error occurs while writing to the file
 */
public void save(File file) throws IOException {
  FileOutputStream fos=new FileOutputStream(file);
  PrintWriter writer=new PrintWriter(fos);
  writer.println("String_Node_Str");
  writer.println();
  outputHeader(0,writer,"String_Node_Str");
  writer.println();
  writer.println("String_Node_Str");
  outputHeader(2,writer,"String_Node_Str");
  for (Iterator i=globalProperties.keySet().iterator(); i.hasNext(); ) {
    String name=(String)i.next();
    String value=(String)globalProperties.get(name);
    writer.println("String_Node_Str" + stripGlobalSymbol(name) + "String_Node_Str"+ value+ "String_Node_Str");
  }
  writer.println();
  outputHeader(2,writer,"String_Node_Str");
  String[] allNames=getInstanceNames(Object.class);
  for (int i=0; i < allNames.length; i++) {
    Symbol symbol=(Symbol)symbolTable.get(allNames[i]);
    PropertySheet ps=symbol.getPropertySheet();
    String[] names=ps.getNames();
    outputHeader(4,writer,symbol.getName());
    writer.println("String_Node_Str" + symbol.getName() + "String_Node_Str"+ "String_Node_Str"+ symbol.getObject().getClass().getName()+ "String_Node_Str");
    for (int j=0; j < names.length; j++) {
      Object obj=ps.getRawNoReplacment(names[j]);
      if (obj instanceof String) {
        String value=(String)obj;
        String pad=(value.length() > 25) ? "String_Node_Str" : "String_Node_Str";
        writer.println("String_Node_Str" + names[j] + "String_Node_Str"+ pad+ "String_Node_Str"+ value+ "String_Node_Str");
      }
 else       if (obj instanceof List) {
        List list=(List)obj;
        writer.println("String_Node_Str" + names[j] + "String_Node_Str");
        for (int k=0; k < list.size(); k++) {
          writer.println("String_Node_Str" + list.get(k) + "String_Node_Str");
        }
        writer.println("String_Node_Str");
      }
 else {
        throw new IOException("String_Node_Str");
      }
    }
    writer.println("String_Node_Str");
    writer.println();
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + new Date() + "String_Node_Str");
  writer.close();
}

Fixed version (ground truth):
/** 
 * Saves the current configuration to the given file
 * @param file place to save the configuration
 * @throws IOException if an error occurs while writing to the file
 */
public void save(File file) throws IOException {
  FileOutputStream fos=new FileOutputStream(file);
  PrintWriter writer=new PrintWriter(fos);
  writer.println("String_Node_Str");
  writer.println();
  outputHeader(0,writer,"String_Node_Str");
  writer.println();
  writer.println("String_Node_Str");
  outputHeader(2,writer,"String_Node_Str");
  for (Iterator i=globalProperties.keySet().iterator(); i.hasNext(); ) {
    String name=(String)i.next();
    String value=(String)globalProperties.get(name);
    value=encodeValue(value);
    writer.println("String_Node_Str" + stripGlobalSymbol(name) + "String_Node_Str"+ value+ "String_Node_Str");
  }
  writer.println();
  outputHeader(2,writer,"String_Node_Str");
  String[] allNames=getInstanceNames(Object.class);
  for (int i=0; i < allNames.length; i++) {
    Symbol symbol=(Symbol)symbolTable.get(allNames[i]);
    PropertySheet ps=symbol.getPropertySheet();
    String[] names=ps.getNames();
    outputHeader(4,writer,symbol.getName());
    writer.println("String_Node_Str" + symbol.getName() + "String_Node_Str"+ "String_Node_Str"+ symbol.getObject().getClass().getName()+ "String_Node_Str");
    for (int j=0; j < names.length; j++) {
      Object obj=ps.getRawNoReplacment(names[j]);
      if (obj instanceof String) {
        String value=(String)obj;
        value=encodeValue(value);
        String pad=(value.length() > 25) ? "String_Node_Str" : "String_Node_Str";
        writer.println("String_Node_Str" + names[j] + "String_Node_Str"+ pad+ "String_Node_Str"+ value+ "String_Node_Str");
      }
 else       if (obj instanceof List) {
        List list=(List)obj;
        writer.println("String_Node_Str" + names[j] + "String_Node_Str");
        for (int k=0; k < list.size(); k++) {
          writer.println("String_Node_Str" + encodeValue(list.get(k).toString()) + "String_Node_Str");
        }
        writer.println("String_Node_Str");
      }
 else {
        throw new IOException("String_Node_Str");
      }
    }
    writer.println("String_Node_Str");
    writer.println();
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + new Date() + "String_Node_Str");
  writer.close();
}