Buggy code:
public class MailerModel extends AbstractTestElement implements Serializable { public static enum MailAuthType { SSL ( "SSL" ) , TLS ( "TLS" ) , NONE ( "" ) ; private final String value ; MailAuthType ( String value ) { } } private static final long serialVersionUID = 233L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String MAIL_SMTP_HOST = "mail.smtp.host" ; private static final String MAIL_SMTP_PORT = "mail.smtp.port" ; private static final String MAIL_SMTP_AUTH = "mail.smtp.auth" ; private static final String MAIL_SMTP_SOCKETFACTORY_CLASS = "mail.smtp.socketFactory.class" ; private static final String MAIL_SMTP_STARTTLS = "mail.smtp.starttls.enable" ; private long failureCount = 0 ; private long successCount = 0 ; private boolean failureMsgSent = false ; private boolean siteDown = false ; private boolean successMsgSent = false ; private static final String FROM_KEY = "MailerModel.fromAddress" ; private static final String TO_KEY = "MailerModel.addressie" ; private static final String HOST_KEY = "MailerModel.smtpHost" ; private static final String PORT_KEY = "MailerModel.smtpPort" ; private static final String SUCCESS_SUBJECT = "MailerModel.successSubject" ; private static final String FAILURE_SUBJECT = "MailerModel.failureSubject" ; private static final String FAILURE_LIMIT_KEY = "MailerModel.failureLimit" ; private static final String SUCCESS_LIMIT_KEY = "MailerModel.successLimit" ; private static final String LOGIN = "MailerModel.login" ; private static final String PASSWORD = "MailerModel.password" ; private static final String MAIL_AUTH_TYPE = "MailerModel.authType" ; private static final String DEFAULT_LIMIT = "2" ; private static final String DEFAULT_SMTP_PORT = "25" ; private static final String DEFAULT_PASSWORD_VALUE = "" ; private static final String DEFAULT_MAIL_AUTH_TYPE_VALUE = MailerModel . MailAuthType . NONE . toString ( ) ; private static final String DEFAULT_LOGIN_VALUE = "" ; private transient ChangeListener changeListener ; public MailerModel ( ) { } public void addChangeListener ( ChangeListener list ) { } @ Override public Object clone ( ) { } public void notifyChangeListeners ( ) { } public List < String > getAddressList ( ) { } public void add ( SampleResult sample ) { } public synchronized void add ( SampleResult sample , boolean sendMails ) { } @ Override public synchronized void clear ( ) { } @ Override public String toString ( ) { } public void sendMail ( String from , List < String > vEmails , String subject , String attText , String smtpHost ) throws MessagingException , AddressException { } public void sendMail ( String from , List < String > vEmails , String subject , String attText , String smtpHost , int smtpPort , final String user , final String password , MailerModel . MailAuthType mailAuthType ) throws MessagingException , AddressException { String host = smtpHost ; boolean debug = Boolean . valueOf ( host ) . booleanValue ( ) ; InternetAddress [ ] address = new InternetAddress [ vEmails . size ( ) ] ; for ( int k = 0 ; k < ( vEmails . size ( ) ) ; k ++ ) { address [ k ] = new InternetAddress ( vEmails . get ( k ) ) ; } Properties props = new Properties ( ) ; props . put ( MailerModel . MAIL_SMTP_HOST , host ) ; <START_BUG> props . put ( MailerModel . MAIL_SMTP_PORT , smtpPort ) ; <END_BUG> Authenticator authenticator = null ; if ( mailAuthType != ( MailerModel . MailAuthType . NONE ) ) { props . put ( MailerModel . MAIL_SMTP_AUTH , "true" ) ; switch ( mailAuthType ) { case SSL : props . put ( MailerModel . MAIL_SMTP_SOCKETFACTORY_CLASS , "javax.net.ssl.SSLSocketFactory" ) ; break ; case TLS : props . put ( MailerModel . MAIL_SMTP_STARTTLS , "true" ) ; break ; default : break ; } } if ( ! ( StringUtils . isEmpty ( user ) ) ) { authenticator = new Authenticator ( ) { @ Override protected PasswordAuthentication getPasswordAuthentication ( ) { return new PasswordAuthentication ( user , password ) ; } } ; } Session session = Session . getInstance ( props , authenticator ) ; session . setDebug ( debug ) ; Message msg = new javax . mail . internet . MimeMessage ( session ) ; msg . setFrom ( new InternetAddress ( from ) ) ; msg . setRecipients ( TO , address ) ; msg . setSubject ( subject ) ; msg . setText ( attText ) ; Transport . send ( msg ) ; } public synchronized void sendTestMail ( ) throws MessagingException , AddressException { } public void setToAddress ( String str ) { } public void setFromAddress ( String str ) { } public void setSmtpHost ( String str ) { } public void setSmtpPort ( String value ) { } public void setLogin ( String login ) { } public void setPassword ( String password ) { } public void setMailAuthType ( String value ) { } public void setFailureSubject ( String str ) { } public void setSuccessSubject ( String str ) { } public void setSuccessLimit ( String limit ) { } public void setFailureLimit ( String limit ) { } public String getToAddress ( ) { } public String getFromAddress ( ) { } public String getSmtpHost ( ) { } public int getSmtpPort ( ) { } public String getFailureSubject ( ) { } public String getSuccessSubject ( ) { } public long getSuccessLimit ( ) { } public long getSuccessCount ( ) { } public long getFailureLimit ( ) { } public long getFailureCount ( ) { } public String getLogin ( ) { } public String getPassword ( ) { } public MailerModel . MailAuthType getMailAuthType ( ) { } }

Fix:
props . put ( MailerModel . MAIL_SMTP_PORT , Integer . toString ( smtpPort ) ) ;