Program: 89824
Project: 89824
Buggy source:
/** 
 * Creates the following scripts for this physical location. * killall. * install. * startall. The scripts for a physical location will only work from Linux/Unix.  
 * @param directory The directory where the scripts are to be placed.
 */
private void makeScripts(File directory){
  ArgumentNotValid.checkNotNull(directory,"String_Node_Str");
  String ext=Constants.UNDERSCORE + name + Constants.SCRIPT_EXTENSION_LINUX;
  File killall=new File(directory,Constants.SCRIPT_NAME_KILL_ALL + ext);
  File install=new File(directory,Constants.SCRIPT_NAME_INSTALL_ALL + ext);
  File startall=new File(directory,Constants.SCRIPT_NAME_START_ALL + ext);
  try {
    PrintWriter kWriter=new PrintWriter(killall);
    PrintWriter iWriter=new PrintWriter(install);
    PrintWriter sWriter=new PrintWriter(startall);
    try {
      kWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      iWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      sWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      for (      Machine mac : machines) {
        iWriter.println(ScriptConstants.writeDashLine());
        iWriter.print(mac.writeToGlobalInstallScript());
        sWriter.println(ScriptConstants.writeDashLine());
        sWriter.print(mac.writeToGlobalStartScript());
        kWriter.println(ScriptConstants.writeDashLine());
        kWriter.print(mac.writeToGlobalKillScript());
      }
      kWriter.println(ScriptConstants.writeDashLine());
      iWriter.println(ScriptConstants.writeDashLine());
      sWriter.println(ScriptConstants.writeDashLine());
    }
  finally {
      if (kWriter != null) {
        kWriter.close();
      }
      if (iWriter != null) {
        iWriter.close();
      }
      if (sWriter != null) {
        sWriter.close();
      }
    }
  }
 catch (  IOException e) {
    String msg="String_Node_Str" + "String_Node_Str" + e;
    log.trace(msg);
    throw new IOFailure(msg);
  }
catch (  Exception e) {
    String msg="String_Node_Str" + "String_Node_Str" + e;
    log.trace(msg);
    System.out.println(msg);
  }
}

Fixed version (ground truth):
/** 
 * Creates the following scripts for this physical location. * killall. * install. * startall. The scripts for a physical location will only work from Linux/Unix.  
 * @param directory The directory where the scripts are to be placed.
 */
private void makeScripts(File directory){
  ArgumentNotValid.checkNotNull(directory,"String_Node_Str");
  String ext=Constants.UNDERSCORE + name + Constants.SCRIPT_EXTENSION_LINUX;
  File killall=new File(directory,Constants.SCRIPT_NAME_KILL_ALL + ext);
  File install=new File(directory,Constants.SCRIPT_NAME_INSTALL_ALL + ext);
  File startall=new File(directory,Constants.SCRIPT_NAME_START_ALL + ext);
  try {
    PrintWriter kWriter=new PrintWriter(killall);
    PrintWriter iWriter=new PrintWriter(install);
    PrintWriter sWriter=new PrintWriter(startall);
    try {
      kWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      iWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      sWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      for (      Machine mac : machines) {
        iWriter.println(ScriptConstants.writeDashLine());
        iWriter.print(mac.writeToGlobalInstallScript());
        sWriter.println(ScriptConstants.writeDashLine());
        sWriter.print(mac.writeToGlobalStartScript());
        kWriter.println(ScriptConstants.writeDashLine());
        kWriter.print(mac.writeToGlobalKillScript());
      }
      kWriter.println(ScriptConstants.writeDashLine());
      iWriter.println(ScriptConstants.writeDashLine());
      sWriter.println(ScriptConstants.writeDashLine());
    }
  finally {
      if (kWriter != null) {
        kWriter.flush();
        kWriter.close();
      }
      if (iWriter != null) {
        iWriter.flush();
        iWriter.close();
      }
      if (sWriter != null) {
        sWriter.flush();
        sWriter.close();
      }
    }
  }
 catch (  IOException e) {
    String msg="String_Node_Str" + "String_Node_Str" + e;
    log.trace(msg);
    throw new IOFailure(msg);
  }
catch (  Exception e) {
    String msg="String_Node_Str" + "String_Node_Str" + e;
    log.trace(msg);
    System.out.println(msg);
  }
}