Program: 90170
Project: 90170
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 int sendEmail(){
  logger.info("String_Node_Str");
  String emailTo=ji.getUserEmail();
  if (emailTo == null) {
    logger.info("String_Node_Str");
    return -1;
  }
 else {
    logger.info("String_Node_Str" + emailTo);
  }
  String fromEmail=config.getString("String_Node_Str","String_Node_Str");
  logger.info("String_Node_Str" + fromEmail);
  String smtpHost=config.getString("String_Node_Str","String_Node_Str");
  logger.debug("String_Node_Str" + smtpHost);
  Properties properties=System.getProperties();
  properties.setProperty("String_Node_Str",smtpHost);
  Authenticator auth=null;
  Boolean enableAuth=config.getBoolean("String_Node_Str",false);
  if (enableAuth) {
    logger.debug("String_Node_Str");
    properties.put("String_Node_Str",enableAuth);
    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)) {
      logger.error("String_Node_Str");
      return -1;
    }
    logger.debug("String_Node_Str" + userName + "String_Node_Str"+ password);
    auth=new SMTPAuthenticator(userName,password);
  }
 else {
    logger.debug("String_Node_Str");
  }
  Session session=Session.getDefaultInstance(properties,auth);
  try {
    MimeMessage message=new MimeMessage(session);
    message.setFrom(new InternetAddress(fromEmail));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(emailTo));
    message.setSubject("String_Node_Str" + ji.getJobName() + "String_Node_Str"+ ji.getStatus());
    String body="String_Node_Str" + "String_Node_Str" + ji.getJobID() + "String_Node_Str"+ "String_Node_Str"+ ji.getJobName()+ "String_Node_Str"+ "String_Node_Str"+ ji.getStatus()+ "String_Node_Str"+ "String_Node_Str"+ ji.getStatusMsg()+ "String_Node_Str"+ "String_Node_Str"+ ji.getOutputURI()+ "String_Node_Str";
    message.setText(body);
    Transport.send(message);
    logger.debug("String_Node_Str");
  }
 catch (  MessagingException mex) {
    mex.printStackTrace();
    return -1;
  }
  return 0;
}

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 int sendEmail(){
  logger.debug("String_Node_Str");
  String emailTo=ji.getUserEmail();
  if (emailTo == null) {
    logger.info("String_Node_Str");
    return -1;
  }
 else {
    logger.info("String_Node_Str" + emailTo);
  }
  String fromEmail=config.getString("String_Node_Str","String_Node_Str");
  logger.info("String_Node_Str" + fromEmail);
  String smtpHost=config.getString("String_Node_Str","String_Node_Str");
  logger.debug("String_Node_Str" + smtpHost);
  Properties properties=System.getProperties();
  properties.setProperty("String_Node_Str",smtpHost);
  Authenticator auth=null;
  if (config.getBoolean("String_Node_Str",false)) {
    logger.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)) {
      logger.error("String_Node_Str");
      return -1;
    }
    logger.debug("String_Node_Str" + userName + "String_Node_Str"+ password);
    auth=new SMTPAuthenticator(userName,password);
  }
 else {
    logger.debug("String_Node_Str");
  }
  Session session=Session.getDefaultInstance(properties,auth);
  try {
    MimeMessage message=new MimeMessage(session);
    message.setFrom(new InternetAddress(fromEmail));
    message.addRecipient(Message.RecipientType.TO,new InternetAddress(emailTo));
    message.setSubject("String_Node_Str" + ji.getJobName() + "String_Node_Str"+ ji.getStatus());
    String body="String_Node_Str" + "String_Node_Str" + ji.getJobID() + "String_Node_Str"+ "String_Node_Str"+ ji.getJobName()+ "String_Node_Str"+ "String_Node_Str"+ ji.getStatus()+ "String_Node_Str"+ "String_Node_Str"+ ji.getStatusMsg()+ "String_Node_Str"+ "String_Node_Str"+ ji.getOutputURI()+ "String_Node_Str";
    message.setText(body);
    Transport.send(message);
    logger.debug("String_Node_Str");
  }
 catch (  MessagingException mex) {
    mex.printStackTrace();
    return -1;
  }
  return 0;
}