Program: 45164
Project: 45164
Buggy source:
private boolean captureChangeLog(Launcher launcher,FilePath workspace,BuildListener listener,Date lastBuildDate,Date currentDate,File changelogFile) throws IOException, InterruptedException {
  boolean result=true;
  SimpleDateFormat scm_datetime_formatter=new SimpleDateFormat(SURROUND_DATETIME_FORMAT_STR);
  String dateRange=scm_datetime_formatter.format(lastBuildDate);
  dateRange=dateRange.concat("String_Node_Str");
  dateRange=dateRange.concat(scm_datetime_formatter.format(currentDate));
  ArgumentListBuilder cmd=new ArgumentListBuilder();
  cmd.add(getSurroundSCMExecutable());
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str".concat(dateRange));
  cmd.addMasked("String_Node_Str".concat(userName).concat("String_Node_Str").concat(password));
  cmd.add("String_Node_Str".concat(server).concat("String_Node_Str").concat(serverPort));
  cmd.add("String_Node_Str".concat(branch));
  cmd.add("String_Node_Str".concat(repository));
  cmd.add("String_Node_Str");
  FileOutputStream os=new FileOutputStream(changelogFile);
  try {
    BufferedOutputStream bos=new BufferedOutputStream(os);
    PrintWriter writer=new PrintWriter(new FileWriter(changelogFile));
    try {
      int cmdResult=launcher.launch().cmds(cmd).envs(new String[0]).stdin(null).stdout(bos).pwd(workspace).join();
      if (cmdResult != 0) {
        listener.fatalError("String_Node_Str" + cmdResult);
        result=false;
      }
    }
  finally {
      writer.close();
      bos.close();
    }
  }
  finally {
    os.close();
  }
  listener.getLogger().println("String_Node_Str");
  listener.getLogger().println("String_Node_Str" + changelogFile.getAbsolutePath());
  return result;
}

Fixed version (ground truth):
private boolean captureChangeLog(Launcher launcher,FilePath workspace,BuildListener listener,Date lastBuildDate,Date currentDate,File changelogFile) throws IOException, InterruptedException {
  boolean result=true;
  SimpleDateFormat scm_datetime_formatter=new SimpleDateFormat(SURROUND_DATETIME_FORMAT_STR);
  String dateRange=scm_datetime_formatter.format(lastBuildDate);
  dateRange=dateRange.concat("String_Node_Str");
  dateRange=dateRange.concat(scm_datetime_formatter.format(currentDate));
  ArgumentListBuilder cmd=new ArgumentListBuilder();
  cmd.add(getSurroundSCMExecutable());
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str");
  cmd.add("String_Node_Str".concat(dateRange));
  cmd.addMasked("String_Node_Str".concat(userName).concat("String_Node_Str").concat(password));
  if (rsaKeyPath != null && !rsaKeyPath.isEmpty()) {
    cmd.add("String_Node_Str".concat(rsaKeyPath));
  }
 else {
    cmd.add("String_Node_Str".concat(server).concat("String_Node_Str").concat(serverPort));
  }
  cmd.add("String_Node_Str".concat(branch));
  cmd.add("String_Node_Str".concat(repository));
  cmd.add("String_Node_Str");
  FileOutputStream os=new FileOutputStream(changelogFile);
  try {
    BufferedOutputStream bos=new BufferedOutputStream(os);
    PrintWriter writer=new PrintWriter(new FileWriter(changelogFile));
    try {
      int cmdResult=launcher.launch().cmds(cmd).envs(new String[0]).stdin(null).stdout(bos).pwd(workspace).join();
      if (cmdResult != 0) {
        listener.fatalError("String_Node_Str" + cmdResult);
        result=false;
      }
    }
  finally {
      writer.close();
      bos.close();
    }
  }
  finally {
    os.close();
  }
  listener.getLogger().println("String_Node_Str");
  listener.getLogger().println("String_Node_Str" + changelogFile.getAbsolutePath());
  return result;
}