Program: 90140
Project: 90140
Buggy source:
/** 
 * Check the properties file to figure out if an email needs to be sent at the end of the job. If yes, get mail properties and try and send email about Job Status.
 * @return 0 for success, -1 for failure
 */
private boolean sendEmail(String emailTo,boolean killed){
  LOG.debug("String_Node_Str");
  if (!this.config.getBoolean("String_Node_Str",false)) {
    LOG.warn("String_Node_Str");
    return false;
  }
  String fromEmail=this.config.getString("String_Node_Str","String_Node_Str");
  LOG.info("String_Node_Str" + fromEmail);
  String smtpHost=this.config.getString("String_Node_Str","String_Node_Str");
  LOG.debug("String_Node_Str" + smtpHost);
  Properties properties=new Properties();
  properties.setProperty("String_Node_Str",smtpHost);
  Authenticator auth=null;
  if (this.config.getBoolean("String_Node_Str",false)) {
    LOG.debug("String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    String userName=config.getString("String_Node_Str");
    String password=config.getString("String_Node_Str");
    if ((userName == null) || (password == null)) {
      LOG.error("String_Node_Str");
      return false;
    }
    LOG.debug("String_Node_Str" + userName + "String_Node_Str"+ password);
    auth=new SMTPAuthenticator(userName,password);
  }
 else {
    LOG.debug("String_Node_Str");
  }
  Session session=Session.getInstance(properties,auth);
  try {
    MimeMessage message=new MimeMessage(session);
    message.setFrom(new InternetAddress(fromEmail));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(emailTo));
    JobStatus jobStatus;
    if (killed) {
      jobStatus=JobStatus.KILLED;
    }
 else {
      jobStatus=job.getStatus();
    }
    message.setSubject("String_Node_Str" + job.getName() + "String_Node_Str"+ jobStatus);
    String body="String_Node_Str" + "String_Node_Str" + job.getId() + "String_Node_Str"+ "String_Node_Str"+ job.getName()+ "String_Node_Str"+ "String_Node_Str"+ job.getStatus()+ "String_Node_Str"+ "String_Node_Str"+ job.getStatusMsg()+ "String_Node_Str"+ "String_Node_Str"+ job.getOutputURI()+ "String_Node_Str";
    message.setText(body);
    Transport.send(message);
    LOG.info("String_Node_Str");
    return true;
  }
 catch (  MessagingException mex) {
    LOG.error("String_Node_Str",mex);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Check the properties file to figure out if an email needs to be sent at the end of the job. If yes, get mail properties and try and send email about Job Status.
 * @return 0 for success, -1 for failure
 */
private boolean sendEmail(String emailTo,boolean killed){
  final Job job=this.jobRepo.findOne(this.jobId);
  LOG.debug("String_Node_Str");
  if (!this.config.getBoolean("String_Node_Str",false)) {
    LOG.warn("String_Node_Str");
    return false;
  }
  String fromEmail=this.config.getString("String_Node_Str","String_Node_Str");
  LOG.info("String_Node_Str" + fromEmail);
  String smtpHost=this.config.getString("String_Node_Str","String_Node_Str");
  LOG.debug("String_Node_Str" + smtpHost);
  Properties properties=new Properties();
  properties.setProperty("String_Node_Str",smtpHost);
  Authenticator auth=null;
  if (this.config.getBoolean("String_Node_Str",false)) {
    LOG.debug("String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    String userName=config.getString("String_Node_Str");
    String password=config.getString("String_Node_Str");
    if ((userName == null) || (password == null)) {
      LOG.error("String_Node_Str");
      return false;
    }
    LOG.debug("String_Node_Str" + userName + "String_Node_Str"+ password);
    auth=new SMTPAuthenticator(userName,password);
  }
 else {
    LOG.debug("String_Node_Str");
  }
  Session session=Session.getInstance(properties,auth);
  try {
    MimeMessage message=new MimeMessage(session);
    message.setFrom(new InternetAddress(fromEmail));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(emailTo));
    JobStatus jobStatus;
    if (killed) {
      jobStatus=JobStatus.KILLED;
    }
 else {
      jobStatus=job.getStatus();
    }
    message.setSubject("String_Node_Str" + job.getName() + "String_Node_Str"+ jobStatus);
    String body="String_Node_Str" + "String_Node_Str" + job.getId() + "String_Node_Str"+ "String_Node_Str"+ job.getName()+ "String_Node_Str"+ "String_Node_Str"+ job.getStatus()+ "String_Node_Str"+ "String_Node_Str"+ job.getStatusMsg()+ "String_Node_Str"+ "String_Node_Str"+ job.getOutputURI()+ "String_Node_Str";
    message.setText(body);
    Transport.send(message);
    LOG.info("String_Node_Str");
    return true;
  }
 catch (  MessagingException mex) {
    LOG.error("String_Node_Str",mex);
    return false;
  }
}