Program: 90173
Project: 90173
Buggy source:
/** 
 * Write a windows start bat file.
 * @param dir               The directory to write the bat file to
 * @param appName           the java class to start
 * @param settingsfn        the settings file to use
 * @param logpropDir        the directory to place the log.prop file
 * @param loggingProperties the contents of the log.prop file
 */
private void writeStartBat(File dir,String appName,String settingsfn,File logpropDir,String loggingProperties){
  String logfn=writeLogPropertiesFile(appName,dir,logpropDir,loggingProperties).replace("String_Node_Str","String_Node_Str");
  try {
    File vbs=new File(dir,"String_Node_Str");
    File batHelper=new File(dir,"String_Node_Str");
    File res=new File(dir,"String_Node_Str");
    PrintWriter pwRes=null;
    PrintWriter pwBat=null;
    PrintWriter pwVbs=null;
    try {
      pwRes=new PrintWriter(new FileWriter(res));
      pwBat=new PrintWriter(new FileWriter(batHelper));
      pwVbs=new PrintWriter(new FileWriter(vbs));
      pwBat.println("String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str");
      pwBat.println("String_Node_Str" + StringUtils.surjoin(getJarFiles(appName),installDirWindows + "String_Node_Str","String_Node_Str"));
      String settingsFile="String_Node_Str" + Settings.SETTINGS_FILE_NAME_PROPERTY + "String_Node_Str"+ settingsfn+ "String_Node_Str";
      String logFile="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + logfn + "String_Node_Str";
      String jmxPasswordFile=installDirWindows + "String_Node_Str" + Constants.JMX_PASSWORD_FILENAME;
      String jmxArgs=getJMXPortParameter() + "String_Node_Str" + jmxPasswordFile+ "String_Node_Str";
      String httpTransferPortArgs=getHttpFileTransferArgs();
      String jmvArgs="String_Node_Str" + StringUtils.surjoin(getJarFiles(appName),installDirWindows + "String_Node_Str","String_Node_Str") + "String_Node_Str";
      String securityArgs="String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str"+ Constants.SECURITY_POLICY_FILE_NAME;
      String cmdline=StringUtils.conjoin("String_Node_Str","String_Node_Str",jmvArgs,settingsFile,logFile,jmxArgs,httpTransferPortArgs,securityArgs,appName);
      cmdline=cmdline.replaceAll("String_Node_Str","String_Node_Str");
      cmdline=cmdline.replaceAll("String_Node_Str","String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str" + "String_Node_Str" + cmdline + "String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str" + "String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwRes.println("String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str");
      pwRes.println("String_Node_Str" + "String_Node_Str" + vbs.getName());
    }
  finally {
      if (pwBat != null) {
        pwBat.close();
      }
      if (pwVbs != null) {
        pwVbs.close();
      }
      if (pwRes != null) {
        pwRes.close();
      }
    }
    appsToStart.add(res.getName());
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + appName,e);
  }
}

Fixed version (ground truth):
/** 
 * Write a windows start bat file.
 * @param dir               The directory to write the bat file to
 * @param appName           the java class to start
 * @param settingsfn        the settings file to use
 * @param logpropDir        the directory to place the log.prop file
 * @param loggingProperties the contents of the log.prop file
 */
private void writeStartBat(File dir,String appName,String settingsfn,File logpropDir,String loggingProperties){
  String logfn=writeLogPropertiesFile(appName,dir,logpropDir,loggingProperties).replace("String_Node_Str","String_Node_Str");
  try {
    File vbs=new File(dir,"String_Node_Str");
    File batHelper=new File(dir,"String_Node_Str");
    File res=new File(dir,"String_Node_Str");
    PrintWriter pwRes=null;
    PrintWriter pwBat=null;
    PrintWriter pwVbs=null;
    try {
      pwRes=new PrintWriter(new FileWriter(res));
      pwBat=new PrintWriter(new FileWriter(batHelper));
      pwVbs=new PrintWriter(new FileWriter(vbs));
      pwBat.println("String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str");
      pwBat.println("String_Node_Str" + StringUtils.surjoin(getJarFiles(appName),installDirWindows + "String_Node_Str","String_Node_Str"));
      String settingsFile="String_Node_Str" + Settings.SETTINGS_FILE_NAME_PROPERTY + "String_Node_Str"+ settingsfn+ "String_Node_Str";
      String logFile="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + logfn + "String_Node_Str";
      String jmxPasswordFile=installDirWindows + "String_Node_Str" + Constants.JMX_PASSWORD_FILENAME;
      String jmxArgs=getJMXPortParameter() + "String_Node_Str" + jmxPasswordFile+ "String_Node_Str";
      String httpTransferPortArgs=getHttpFileTransferArgs();
      String jmvArgs="String_Node_Str" + StringUtils.surjoin(getJarFiles(appName),installDirWindows + "String_Node_Str","String_Node_Str") + "String_Node_Str";
      String securityArgs="String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str"+ Constants.SECURITY_POLICY_FILE_NAME+ "String_Node_Str";
      String cmdline=StringUtils.conjoin("String_Node_Str","String_Node_Str",jmvArgs,settingsFile,logFile,jmxArgs,httpTransferPortArgs,securityArgs,appName);
      cmdline=cmdline.replaceAll("String_Node_Str","String_Node_Str");
      cmdline=cmdline.replaceAll("String_Node_Str","String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str" + "String_Node_Str" + cmdline + "String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str" + "String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwVbs.println("String_Node_Str");
      pwRes.println("String_Node_Str" + "String_Node_Str" + installDirWindows + "String_Node_Str");
      pwRes.println("String_Node_Str" + "String_Node_Str" + vbs.getName());
    }
  finally {
      if (pwBat != null) {
        pwBat.close();
      }
      if (pwVbs != null) {
        pwVbs.close();
      }
      if (pwRes != null) {
        pwRes.close();
      }
    }
    appsToStart.add(res.getName());
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + appName,e);
  }
}