Program: 44403
Project: 44403
Buggy source:
private CharSequence formatMessage(MessageItem msgItem,String contact,String body,String subject,String timestamp,Pattern highlight,String contentType){
  CharSequence template=mContext.getResources().getText(R.string.name_colon);
  SpannableStringBuilder buf=new SpannableStringBuilder(TextUtils.replace(template,new String[]{"String_Node_Str"},new CharSequence[]{contact}));
  boolean hasSubject=!TextUtils.isEmpty(subject);
  if (hasSubject) {
    buf.append(mContext.getResources().getString(R.string.inline_subject,subject));
  }
  if (!TextUtils.isEmpty(body)) {
    if (contentType != null && ContentType.TEXT_HTML.equals(contentType)) {
      buf.append("String_Node_Str");
      buf.append(Html.fromHtml(body));
    }
 else {
      if (hasSubject) {
        buf.append("String_Node_Str");
      }
      SmileyParser parser=SmileyParser.getInstance();
      buf.append(parser.addSmileySpans(body));
    }
  }
  if (msgItem.isSending()) {
    timestamp=mContext.getResources().getString(R.string.sending_message);
  }
  if (!TextUtils.isEmpty(timestamp)) {
    buf.append("String_Node_Str");
    int startOffset=buf.length();
    startOffset=buf.length();
    buf.append(timestamp);
    buf.setSpan(mTextSmallSpan,startOffset,buf.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    buf.setSpan(mSpan,startOffset + 1,buf.length(),0);
    buf.setSpan(mColorSpan,startOffset,buf.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  }
  if (highlight != null) {
    Matcher m=highlight.matcher(buf.toString());
    while (m.find()) {
      buf.setSpan(new StyleSpan(Typeface.BOLD),m.start(),m.end(),0);
    }
  }
  buf.setSpan(mLeadingMarginSpan,0,buf.length(),0);
  return buf;
}

Fixed version (ground truth):
private CharSequence formatMessage(MessageItem msgItem,String contact,String body,String subject,String timestamp,Pattern highlight,String contentType){
  CharSequence template=mContext.getResources().getText(R.string.name_colon);
  SpannableStringBuilder buf=new SpannableStringBuilder(TextUtils.replace(template,new String[]{"String_Node_Str"},new CharSequence[]{contact}));
  boolean hasSubject=!TextUtils.isEmpty(subject);
  if (hasSubject) {
    buf.append(mContext.getResources().getString(R.string.inline_subject,subject));
  }
  if (!TextUtils.isEmpty(body)) {
    if (contentType != null && ContentType.TEXT_HTML.equals(contentType)) {
      buf.append("String_Node_Str");
      buf.append(Html.fromHtml(body));
    }
 else {
      if (hasSubject) {
        buf.append("String_Node_Str");
      }
      SmileyParser parser=SmileyParser.getInstance();
      buf.append(parser.addSmileySpans(body));
    }
  }
  if (msgItem.isSending()) {
    timestamp=mContext.getResources().getString(R.string.sending_message);
  }
  buf.append("String_Node_Str");
  int startOffset=buf.length();
  startOffset=buf.length();
  buf.append(TextUtils.isEmpty(timestamp) ? "String_Node_Str" : timestamp);
  buf.setSpan(mTextSmallSpan,startOffset,buf.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  buf.setSpan(mSpan,startOffset + 1,buf.length(),0);
  buf.setSpan(mColorSpan,startOffset,buf.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  if (highlight != null) {
    Matcher m=highlight.matcher(buf.toString());
    while (m.find()) {
      buf.setSpan(new StyleSpan(Typeface.BOLD),m.start(),m.end(),0);
    }
  }
  buf.setSpan(mLeadingMarginSpan,0,buf.length(),0);
  return buf;
}