Buggy code:
public class MailNotifierServiceImpl implements NotifierService { private final String smtpServer ; private final String smtpUser ; private final String smtpPassword ; private final int smtpPort ; private final boolean needsAuth ; private final String charset ; private final boolean displayLogo ; private final boolean displayLicenceLogo ; private final String externalLogo ; private static final Logger logger = LoggerFactory . getLogger ( MailNotifierServiceImpl . class ) ; private static final CharsetEncoder asciiEncoder = Charset . forName ( "US-ASCII" ) . newEncoder ( ) ; public MailNotifierServiceImpl ( String smtpServer , int smtpPort , String smtpUser , String smtpPassword , boolean needsAuth , String charset , boolean displayLogo , boolean displayLicenceLogo , String externalLogo ) { } public static boolean isPureAscii ( String v ) { } @ Override public void sendNotification ( String smtpSender , String replyTo , String recipient , String subject , String htmlContent , String textContent , String inReplyTo , String references ) throws SendFailedException { if ( smtpServer . equals ( "" ) ) { MailNotifierServiceImpl . logger . warn ( "Mail<seq2seq4repair_space>notifications<seq2seq4repair_space>are<seq2seq4repair_space>disabled." ) ; return ; } Session session = getMailSession ( ) ; MimeMessage messageMim = new MimeMessage ( session ) ; try { messageMim . setFrom ( new InternetAddress ( smtpSender ) ) ; if ( replyTo != null ) { InternetAddress [ ] reply = new InternetAddress [ 1 ] ; reply [ 0 ] = new InternetAddress ( replyTo ) ; messageMim . setReplyTo ( reply ) ; } messageMim . addRecipient ( TO , new InternetAddress ( recipient ) ) ; if ( ( inReplyTo != null ) && ( inReplyTo != "" ) ) { if ( MailNotifierServiceImpl . isPureAscii ( inReplyTo ) ) { messageMim . setHeader ( "In-Reply-To" , inReplyTo ) ; } } if ( ( references != null ) && ( references != "" ) ) { if ( MailNotifierServiceImpl . isPureAscii ( references ) ) { messageMim . setHeader ( "References" , references ) ; } } messageMim . setSubject ( subject , charset ) ; Multipart mp = new MimeMultipart ( "alternative" ) ; Multipart html_mp = new MimeMultipart ( "related" ) ; BodyPart rel_bph = new MimeBodyPart ( ) ; rel_bph . setDataHandler ( new DataHandler ( new ByteArrayDataSource ( htmlContent , ( "text//html;<seq2seq4repair_space>charset=" + ( charset ) ) ) ) ) ; html_mp . addBodyPart ( rel_bph ) ; if ( ( displayLogo ) || ( displayLicenceLogo ) ) { String cid = "image.part.1@linshare.org" ; MimeBodyPart rel_bpi = new MimeBodyPart ( ) ; rel_bpi . setFileName ( "mail_logo.png" ) ; rel_bpi . setText ( "linshare" ) ; URL resource = null ; if ( displayLicenceLogo ) { resource = getClass ( ) . getResource ( "//org//linagora//linshare//core//service//mail_logo_licence.png" ) ; } else { <START_BUG> if ( ( externalLogo ) != null ) { <END_BUG> File file = new File ( externalLogo ) ; if ( file . canRead ( ) ) { resource = file . toURI ( ) . toURL ( ) ; } else { MailNotifierServiceImpl . logger . error ( "Can<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>your<seq2seq4repair_space>personal<seq2seq4repair_space>logo." ) ; } } if ( resource == null ) { resource = getClass ( ) . getResource ( "//org//linagora//linshare//core//service//mail_logo.png" ) ; } } if ( resource == null ) { MailNotifierServiceImpl . logger . error ( "Embedded<seq2seq4repair_space>logo<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; throw new org . linagora . linshare . core . exception . TechnicalException ( TechnicalErrorCode . MAIL_EXCEPTION , "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification<seq2seq4repair_space>:<seq2seq4repair_space>embedded<seq2seq4repair_space>logo<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; } rel_bpi . setDataHandler ( new DataHandler ( resource ) ) ; rel_bpi . setHeader ( "Content-ID" , ( ( "<" + cid ) + ">" ) ) ; rel_bpi . setDisposition ( "inline" ) ; html_mp . addBodyPart ( rel_bpi ) ; } BodyPart alt_bp2 = new MimeBodyPart ( ) ; alt_bp2 . setContent ( html_mp ) ; mp . addBodyPart ( alt_bp2 ) ; messageMim . setContent ( mp ) ; messageMim . setSentDate ( new GregorianCalendar ( ) . getTime ( ) ) ; Transport tr = session . getTransport ( "smtp" ) ; if ( needsAuth ) { tr . connect ( smtpServer , smtpPort , smtpUser , smtpPassword ) ; messageMim . saveChanges ( ) ; tr . sendMessage ( messageMim , messageMim . getAllRecipients ( ) ) ; tr . close ( ) ; } else { Transport . send ( messageMim ) ; } } catch ( SendFailedException e ) { MailNotifierServiceImpl . logger . error ( ( ( ( ( ( "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification<seq2seq4repair_space>on<seq2seq4repair_space>" + ( smtpServer ) ) + "<seq2seq4repair_space>port<seq2seq4repair_space>" ) + ( smtpPort ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + recipient ) , e ) ; throw e ; } catch ( MessagingException e ) { MailNotifierServiceImpl . logger . error ( ( ( ( "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification<seq2seq4repair_space>on<seq2seq4repair_space>" + ( smtpServer ) ) + "<seq2seq4repair_space>port<seq2seq4repair_space>" ) + ( smtpPort ) ) , e ) ; throw new org . linagora . linshare . core . exception . TechnicalException ( TechnicalErrorCode . MAIL_EXCEPTION , "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification" , e ) ; } catch ( Exception e ) { MailNotifierServiceImpl . logger . error ( ( ( ( "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification<seq2seq4repair_space>on<seq2seq4repair_space>" + ( smtpServer ) ) + "<seq2seq4repair_space>port<seq2seq4repair_space>" ) + ( smtpPort ) ) , e ) ; throw new org . linagora . linshare . core . exception . TechnicalException ( TechnicalErrorCode . MAIL_EXCEPTION , "Error<seq2seq4repair_space>sending<seq2seq4repair_space>notification" , e ) ; } } private Session getMailSession ( ) { } @ Override public void sendNotification ( String smtpSender , String replyTo , String recipient , MailContainer mailContainer ) throws SendFailedException { } @ Override public void sendNotification ( List < MailContainerWithRecipient > mailContainerWithRecipient ) throws BusinessException { } @ Override public void sendNotification ( MailContainerWithRecipient mailContainer ) throws BusinessException { } }

Fix:
if ( ( ( externalLogo ) != null ) && ( ! ( "" . equals ( externalLogo ) ) ) ) {