Buggy code:
public class MailHandlerServlet extends HttpServlet { private static final String CRLF = "\r\n" ; private static final String WinlinkSuffix = "winlink.org>" ; @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } private MailHandlerServlet . BlogAuthor setNamespace ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } private void handleMail ( HttpServletRequest request , HttpServletResponse response , MailHandlerServlet . BlogAuthor blogAuthor ) throws EntityNotFoundException , IOException , MessagingException , ServletException , HttpException { DS ds = DS . get ( ) ; Properties props = new Properties ( ) ; Session session = Session . getDefaultInstance ( props , null ) ; MimeMessage message = new MimeMessage ( session , request . getInputStream ( ) ) ; String messageId = getMessageId ( message ) ; String contentType = message . getContentType ( ) ; if ( messageId == null ) { log ( "messageID<seq2seq4repair_space>missing" ) ; response . sendError ( SC_BAD_REQUEST ) ; return ; } log ( ( "Message-ID=" + messageId ) ) ; if ( handleSpot ( message ) ) { return ; } InternetAddress sender = ( ( InternetAddress ) ( message . getSender ( ) ) ) ; log ( ( "sender=" + sender ) ) ; if ( sender == null ) { Address [ ] from = message . getFrom ( ) ; if ( ( from != null ) && ( ( from . length ) != 0 ) ) { sender = ( ( InternetAddress ) ( from [ 0 ] ) ) ; } } if ( sender == null ) { log ( "Sender<seq2seq4repair_space>missing" ) ; response . sendError ( SC_BAD_REQUEST ) ; return ; } Email senderEmail = new Email ( sender . getAddress ( ) ) ; Settings settings = ds . getSettingsFor ( senderEmail ) ; if ( settings == null ) { log ( ( ( senderEmail . getEmail ( ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>blogs" ) ) ; response . sendError ( SC_FORBIDDEN ) ; return ; } String [ ] ripperDate = message . getHeader ( ( ( BlogRipper ) + "Date" ) ) ; boolean ripping = ( ripperDate != null ) && ( ( ripperDate . length ) > 0 ) ; Object content = message . getContent ( ) ; if ( content instanceof Multipart ) { Multipart multipart = ( ( Multipart ) ( message . getContent ( ) ) ) ; List < BodyPart > bodyPartList = findParts ( multipart ) ; try { Entity blog = null ; String htmlBody = getHtmlBody ( bodyPartList ) ; if ( ( htmlBody != null ) && ( ( htmlBody . length ( ) ) > 10 ) ) { <START_BUG> boolean publishImmediately = true ; <END_BUG> blog = updateBlog ( messageId , message , htmlBody , publishImmediately , senderEmail ) ; if ( ! ripping ) { if ( blog != null ) { sendMail ( request , blogAuthor , blog , settings ) ; } } else { log ( "not<seq2seq4repair_space>sending<seq2seq4repair_space>email<seq2seq4repair_space>because<seq2seq4repair_space>ripping" ) ; } } else { log ( "no<seq2seq4repair_space>html<seq2seq4repair_space>body" ) ; } List < Future < HTTPResponse > > futureList = new ArrayList < Future < HTTPResponse > > ( ) ; for ( BodyPart bodyPart : bodyPartList ) { Collection < Future < HTTPResponse > > futures = handleBodyPart ( request , blog , bodyPart , settings ) ; if ( futures != null ) { futureList . addAll ( futures ) ; } } long remainingMillis = ApiProxy . getCurrentEnvironment ( ) . getRemainingMillis ( ) ; log ( ( "remainingMillis=" + remainingMillis ) ) ; for ( Future < HTTPResponse > res : futureList ) { try { HTTPResponse hr = res . get ( ) ; log ( ( "code=" + ( hr . getResponseCode ( ) ) ) ) ; if ( ( hr . getResponseCode ( ) ) != ( HttpServletResponse . SC_OK ) ) { throw new ServletException ( ( "blob<seq2seq4repair_space>upload<seq2seq4repair_space>failed<seq2seq4repair_space>code=" + ( hr . getResponseCode ( ) ) ) ) ; } } catch ( InterruptedException ex ) { throw new IOException ( ex ) ; } catch ( ExecutionException ex ) { throw new IOException ( ex ) ; } } } catch ( MessagingException ex ) { throw new IOException ( ex ) ; } } else { if ( content instanceof String ) { String bodyPart = ( ( String ) ( content ) ) ; if ( contentType . startsWith ( "text//plain" ) ) { bodyPart = textPlainToHtml ( bodyPart ) ; } boolean publishImmediately = settings . isPublishImmediately ( ) ; Entity blog = updateBlog ( messageId , message , bodyPart , publishImmediately , senderEmail ) ; if ( blog != null ) { sendMail ( request , blogAuthor , blog , settings ) ; } } else { log ( "body<seq2seq4repair_space>not<seq2seq4repair_space>MultiPart<seq2seq4repair_space>of<seq2seq4repair_space>String" ) ; } } } private void setProperty ( MimeMessage message , String name , Entity blog , boolean indexed ) throws IOException , MessagingException { } private Object getHeader ( MimeMessage message , String name ) throws IOException , MessagingException { } private Collection < Future < HTTPResponse > > handleBodyPart ( HttpServletRequest request , Entity blog , BodyPart bodyPart , final Settings settings ) throws IOException , MessagingException { } private Future < HTTPResponse > postBlobs ( String filename , String contentType , String sha1 , byte [ ] data , String metadataSize , HttpServletRequest request , int width , int height ) throws IOException , MessagingException { } private List < BodyPart > findParts ( Multipart multipart ) throws IOException , MessagingException { } private void findParts ( List < BodyPart > list , Multipart multipart ) throws IOException , MessagingException { } private void remove ( String encoded , HttpServletResponse response ) throws IOException { }

Fix:
boolean publishImmediately = settings . isPublishImmediately ( ) ;