Program: 89819
Project: 89819
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.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" + name + "String_Node_Str";
    log.trace(msg,e);
    throw new IOFailure(msg,e);
  }
}

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);
    try {
      kWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      for (      Machine mac : machines) {
        kWriter.println(ScriptConstants.writeDashLine());
        kWriter.print(mac.writeToGlobalKillScript());
      }
      kWriter.println(ScriptConstants.writeDashLine());
    }
  finally {
      kWriter.flush();
      kWriter.close();
    }
    PrintWriter iWriter=new PrintWriter(install);
    try {
      iWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      for (      Machine mac : machines) {
        iWriter.println(ScriptConstants.writeDashLine());
        iWriter.print(mac.writeToGlobalInstallScript());
      }
      iWriter.println(ScriptConstants.writeDashLine());
    }
  finally {
      iWriter.flush();
      iWriter.close();
    }
    PrintWriter sWriter=new PrintWriter(startall);
    try {
      sWriter.println(ScriptConstants.BIN_BASH_COMMENT);
      for (      Machine mac : machines) {
        sWriter.println(ScriptConstants.writeDashLine());
        sWriter.print(mac.writeToGlobalStartScript());
      }
      sWriter.println(ScriptConstants.writeDashLine());
    }
  finally {
      sWriter.flush();
      sWriter.close();
    }
  }
 catch (  IOException e) {
    String msg="String_Node_Str" + "String_Node_Str" + name + "String_Node_Str";
    log.trace(msg,e);
    throw new IOFailure(msg,e);
  }
}