Buggy code:
if ( account != null ) { mMessageReference = messageReference ; } } catch ( MessagingException e ) { Log . e ( LOG_TAG , "Could<seq2seq4repair_space>not<seq2seq4repair_space>decode<seq2seq4repair_space>message<seq2seq4repair_space>reference<seq2seq4repair_space>in<seq2seq4repair_space>identity." , e ) ; } } int cursorPosition = 0 ; if ( k9identity . containsKey ( MessageCompose . IdentityField . CURSOR_POSITION ) ) { try { <START_BUG> cursorPosition = Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . CURSOR_POSITION ) ) . intValue ( ) ; <END_BUG> } catch ( Exception e ) { Log . e ( LOG_TAG , "Could<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>cursor<seq2seq4repair_space>position<seq2seq4repair_space>for<seq2seq4repair_space>MessageCompose;<seq2seq4repair_space>continuing." , e ) ; } } if ( k9identity . containsKey ( MessageCompose . IdentityField . QUOTED_TEXT_MODE ) ) { showQuotedTextMode = k9identity . get ( MessageCompose . IdentityField . QUOTED_TEXT_MODE ) ; } mIdentity = newIdentity ; updateSignature ( ) ; updateFrom ( ) ; Integer bodyLength = ( ( k9identity . get ( MessageCompose . IdentityField . LENGTH ) ) != null ) ? Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . LENGTH ) ) : 0 ; Integer bodyOffset = ( ( k9identity . get ( MessageCompose . IdentityField . OFFSET ) ) != null ) ? Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . OFFSET ) ) : 0 ; Integer bodyFooterOffset = ( ( k9identity . get ( MessageCompose . IdentityField . FOOTER_OFFSET ) ) != null ) ? Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . FOOTER_OFFSET ) ) : null ; Integer bodyPlainLength = ( ( k9identity . get ( MessageCompose . IdentityField . PLAIN_LENGTH ) ) != null ) ? Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . PLAIN_LENGTH ) ) : null ; Integer bodyPlainOffset = ( ( k9identity . get ( MessageCompose . IdentityField . PLAIN_OFFSET ) ) != null ) ? Integer . valueOf ( k9identity . get ( MessageCompose . IdentityField . PLAIN_OFFSET ) ) : null ; mQuoteStyle = ( ( k9identity . get ( MessageCompose . IdentityField . QUOTE_STYLE ) ) != null ) ? QuoteStyle . valueOf ( k9identity . get ( MessageCompose . IdentityField . QUOTE_STYLE ) ) : mAccount . getQuoteStyle ( ) ; MessageCompose . QuotedTextMode quotedMode ; try { quotedMode = MessageCompose . QuotedTextMode . valueOf ( showQuotedTextMode ) ; } catch ( Exception e ) { quotedMode = MessageCompose . QuotedTextMode . NONE ; } String messageFormatString = k9identity . get ( MessageCompose . IdentityField . MESSAGE_FORMAT ) ; MessageFormat messageFormat = null ; if ( messageFormatString != null ) { try { messageFormat = MessageFormat . valueOf ( messageFormatString ) ; } catch ( Exception e ) { } } if ( messageFormat == null ) { mMessageContentView . setCharacters ( getBodyTextFromMessage ( message , MessageCompose . SimpleMessageFormat . TEXT ) ) ; mForcePlainText = true ; showOrHideQuotedText ( quotedMode ) ; return ; } if ( messageFormat == ( MessageFormat . HTML ) ) { Part part = MimeUtility . findFirstPartByMimeType ( message , "text//html" ) ; if ( part != null ) { mQuotedTextFormat = MessageCompose . SimpleMessageFormat . HTML ; String text = MessageExtractor . getTextFromPart ( part ) ; if ( K9 . DEBUG ) { Log . d ( LOG_TAG , ( ( ( ( ( ( "Loading<seq2seq4repair_space>message<seq2seq4repair_space>with<seq2seq4repair_space>offset<seq2seq4repair_space>" + bodyOffset ) + ",<seq2seq4repair_space>length<seq2seq4repair_space>" ) + bodyLength ) + ".<seq2seq4repair_space>Text<seq2seq4repair_space>length<seq2seq4repair_space>is<seq2seq4repair_space>" ) + ( text . length ( ) ) ) + "." ) ) ; } if ( ( bodyOffset + bodyLength ) > ( text . length ( ) ) ) { Log . d ( LOG_TAG , "The<seq2seq4repair_space>identity<seq2seq4repair_space>field<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>draft<seq2seq4repair_space>contains<seq2seq4repair_space>an<seq2seq4repair_space>invalid<seq2seq4repair_space>LENGTH//OFFSET" ) ; bodyOffset = 0 ; bodyLength = 0 ; } String bodyText = text . substring ( bodyOffset , ( bodyOffset + bodyLength ) ) ; mMessageContentView . setCharacters ( HtmlConverter . htmlToText ( bodyText ) ) ; StringBuilder quotedHTML = new StringBuilder ( ) ; quotedHTML . append ( text . substring ( 0 , bodyOffset ) ) ; quotedHTML . append ( text . substring ( ( bodyOffset + bodyLength ) ) ) ; if ( ( quotedHTML . length ( ) ) > 0 ) { mQuotedHtmlContent = new InsertableHtmlContent ( ) ; mQuotedHtmlContent . setQuotedContent ( quotedHTML ) ; mQuotedHtmlContent . setHeaderInsertionPoint ( bodyOffset ) ; if ( bodyFooterOffset != null ) { mQuotedHtmlContent . setFooterInsertionPoint ( bodyFooterOffset ) ; } else { mQuotedHtmlContent . setFooterInsertionPoint ( bodyOffset ) ; } mQuotedHTML . setText ( mQuotedHtmlContent . getQuotedContent ( ) ) ; } } if ( ( bodyPlainOffset != null ) && ( bodyPlainLength != null ) ) { processSourceMessageText ( message , bodyPlainOffset , bodyPlainLength , false ) ; } } else if ( messageFormat == ( MessageFormat . TEXT ) ) { mQuotedTextFormat = MessageCompose . SimpleMessageFormat . TEXT ; processSourceMessageText ( message , bodyOffset , bodyLength , true ) ; } else { Log . e ( LOG_TAG , "Unhandled<seq2seq4repair_space>message<seq2seq4repair_space>format." ) ; } try { mMessageContentView . setSelection ( cursorPosition ) ; } catch ( Exception e ) { Log . e ( LOG_TAG , "Could<seq2seq4repair_space>not<seq2seq4repair_space>set<seq2seq4repair_space>cursor<seq2seq4repair_space>position<seq2seq4repair_space>in<seq2seq4repair_space>MessageCompose;<seq2seq4repair_space>ignoring." , e ) ; } showOrHideQuotedText ( quotedMode ) ; } private void processSourceMessageText ( Message message , Integer bodyOffset , Integer bodyLength , boolean viewMessageContent ) throws MessagingException { } private static final Pattern DASH_SIGNATURE_PLAIN = Pattern . compile ( "\r\n--<seq2seq4repair_space>\r\n.*" , Pattern . DOTALL ) ; private static final Pattern DASH_SIGNATURE_HTML = Pattern . compile ( "(<br(<seq2seq4repair_space>//)?>|\r?\n)--<seq2seq4repair_space><br(<seq2seq4repair_space>//)?>" , Pattern . CASE_INSENSITIVE ) ; private static final Pattern BLOCKQUOTE_START = Pattern . compile ( "<blockquote" , Pattern . CASE_INSENSITIVE ) ; private static final Pattern BLOCKQUOTE_END = Pattern . compile ( "<//blockquote>" , Pattern . CASE_INSENSITIVE ) ; private void populateUIWithQuotedMessage ( boolean showQuotedText ) throws MessagingException { } private String getBodyTextFromMessage ( final Message message , final MessageCompose . SimpleMessageFormat format ) throws MessagingException { } private static final Pattern FIND_INSERTION_POINT_HTML = Pattern . compile ( "(?si:.*?(<html(?:>|\\s+[^>]*>)).*)" ) ; private static final Pattern FIND_INSERTION_POINT_HEAD = Pattern . compile ( "(?si:.*?(<head(?:>|\\s+[^>]*>)).*)" ) ; private static final Pattern FIND_INSERTION_POINT_BODY = Pattern . compile ( "(?si:.*?(<body(?:>|\\s+[^>]*>)).*)" ) ; private static final Pattern FIND_INSERTION_POINT_HTML_END = Pattern . compile ( "(?si:.*(<//html>).*?)" ) ; private static final Pattern FIND_INSERTION_POINT_BODY_END = Pattern . compile ( "(?si:.*(<//body>).*?)" ) ; private static final int FIND_INSERTION_POINT_FIRST_GROUP = 1 ; private static final String FIND_INSERTION_POINT_HTML_CONTENT = "<!DOCTYPE<seq2seq4repair_space>html<seq2seq4repair_space>PUBLIC<seq2seq4repair_space>\"-////W3C////DTD<seq2seq4repair_space>HTML<seq2seq4repair_space>4.0<seq2seq4repair_space>Transitional////EN\">\r\n<html>" ; private static final String FIND_INSERTION_POINT_HTML_END_CONTENT = "<//html>" ; private static final String FIND_INSERTION_POINT_HEAD_CONTENT = "<head><meta<seq2seq4repair_space>content=\"text//html;<seq2seq4repair_space>charset=utf-8\"<seq2seq4repair_space>http-equiv=\"Content-Type\"><//head>"

Fix:
cursorPosition = Integer . parseInt ( k9identity . get ( MessageCompose . IdentityField . CURSOR_POSITION ) ) ;