Program: 160439
Project: 160439
Buggy source:
public void send() throws MessagingException {
  Properties props=new Properties();
  ServerSettings serverSettings=bimServer.getServerSettingsCache().getServerSettings();
  props.put("String_Node_Str","String_Node_Str");
  String smtpProps=serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS ? "String_Node_Str" : "String_Node_Str";
  props.put(smtpProps,serverSettings.getSmtpPort());
  if (serverSettings.getSmtpProtocol() == SmtpProtocol.STARTTLS) {
    props.put("String_Node_Str","String_Node_Str");
  }
  Session mailSession=Session.getDefaultInstance(props);
  Transport transport=null;
  try {
    if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTP) {
      transport=new SMTPTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    }
 else     if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS) {
      transport=new SMTPSSLTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    }
    transport.connect(serverSettings.getSmtpServer(),serverSettings.getSmtpUsername(),serverSettings.getSmtpPassword());
    Message message=new MimeMessage(mailSession);
    message.setSubject(subject);
    message.setRecipients(to,addressTo);
    message.setContent(body,contentType);
    message.setFrom(from);
    transport.sendMessage(message,addressTo);
  }
 catch (  MessagingException e) {
    LOGGER.error("String_Node_Str" + body + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public void send() throws MessagingException {
  Properties props=new Properties();
  ServerSettings serverSettings=bimServer.getServerSettingsCache().getServerSettings();
  props.put("String_Node_Str","String_Node_Str");
  String smtpProps=serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS ? "String_Node_Str" : "String_Node_Str";
  props.put(smtpProps,serverSettings.getSmtpPort());
  if (serverSettings.getSmtpProtocol() == SmtpProtocol.STARTTLS) {
    props.put("String_Node_Str","String_Node_Str");
  }
  Session mailSession=Session.getDefaultInstance(props);
  Transport transport=null;
  try {
    if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTP) {
      transport=new SMTPTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    }
 else     if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS) {
      transport=new SMTPSSLTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    }
 else     if (serverSettings.getSmtpProtocol() == SmtpProtocol.STARTTLS) {
      transport=new SMTPSSLTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    }
 else {
      throw new RuntimeException("String_Node_Str" + serverSettings.getSmtpProtocol());
    }
    transport.connect(serverSettings.getSmtpServer(),serverSettings.getSmtpUsername(),serverSettings.getSmtpPassword());
    Message message=new MimeMessage(mailSession);
    message.setSubject(subject);
    message.setRecipients(to,addressTo);
    message.setContent(body,contentType);
    message.setFrom(from);
    transport.sendMessage(message,addressTo);
  }
 catch (  MessagingException e) {
    LOGGER.error("String_Node_Str" + body + "String_Node_Str"+ e.getMessage());
  }
}