Program: 14810
Project: 14810
Buggy source:
public void savePostContent(boolean isAutoSave){
  Post post=mActivity.getPost();
  if (post == null || mContentEditText.getText() == null)   return;
  String title=(mTitleEditText.getText() != null) ? mTitleEditText.getText().toString() : "String_Node_Str";
  String content;
  Editable postContentEditable;
  try {
    postContentEditable=new SpannableStringBuilder(mContentEditText.getText());
  }
 catch (  IndexOutOfBoundsException e) {
    postContentEditable=mContentEditText.getText();
  }
  if (postContentEditable == null)   return;
  if (post.isLocalDraft()) {
    if (android.os.Build.VERSION.SDK_INT >= 14) {
      CharacterStyle[] characterStyles=postContentEditable.getSpans(0,postContentEditable.length(),CharacterStyle.class);
      for (      CharacterStyle characterStyle : characterStyles) {
        if (characterStyle.getClass().getName().equals("String_Node_Str"))         postContentEditable.removeSpan(characterStyle);
      }
    }
    content=WPHtml.toHtml(postContentEditable);
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 else {
    WPImageSpan[] imageSpans=postContentEditable.getSpans(0,postContentEditable.length(),WPImageSpan.class);
    if (imageSpans.length != 0) {
      for (      WPImageSpan wpIS : imageSpans) {
        MediaFile mediaFile=wpIS.getMediaFile();
        if (mediaFile == null)         continue;
        if (mediaFile.getMediaId() != null) {
          updateMediaFileOnServer(wpIS);
        }
 else {
          mediaFile.setFileName(wpIS.getImageSource().toString());
          mediaFile.setFilePath(wpIS.getImageSource().toString());
          mediaFile.save();
        }
        int tagStart=postContentEditable.getSpanStart(wpIS);
        if (!isAutoSave) {
          postContentEditable.removeSpan(wpIS);
          if (mediaFile.getMediaId() != null && mediaFile.getMediaId().length() > 0) {
            postContentEditable.insert(tagStart,WPHtml.getContent(wpIS));
          }
 else {
            postContentEditable.insert(tagStart,"String_Node_Str" + wpIS.getImageSource().toString() + "String_Node_Str");
          }
        }
      }
    }
    content=postContentEditable.toString();
  }
  if (!isAutoSave) {
    MediaGalleryImageSpan[] gallerySpans=postContentEditable.getSpans(0,postContentEditable.length(),MediaGalleryImageSpan.class);
    for (    MediaGalleryImageSpan gallerySpan : gallerySpans) {
      int start=postContentEditable.getSpanStart(gallerySpan);
      postContentEditable.removeSpan(gallerySpan);
      postContentEditable.insert(start,WPHtml.getGalleryShortcode(gallerySpan));
    }
  }
  String moreTag="String_Node_Str";
  post.setTitle(title);
  if (post.isLocalDraft() && content.contains(moreTag)) {
    post.setDescription(content.substring(0,content.indexOf(moreTag)));
    post.setMt_text_more(content.substring(content.indexOf(moreTag) + moreTag.length(),content.length()));
  }
 else {
    post.setDescription(content);
    post.setMt_text_more("String_Node_Str");
  }
  if (!post.isLocalDraft())   post.setLocalChange(true);
  post.update();
}

Fixed version (ground truth):
public void savePostContent(boolean isAutoSave){
  Post post=mActivity.getPost();
  if (post == null || mContentEditText.getText() == null)   return;
  String title=(mTitleEditText.getText() != null) ? mTitleEditText.getText().toString() : "String_Node_Str";
  String content;
  Editable postContentEditable;
  try {
    postContentEditable=new SpannableStringBuilder(mContentEditText.getText());
  }
 catch (  IndexOutOfBoundsException e) {
    postContentEditable=mContentEditText.getText();
  }
  if (postContentEditable == null)   return;
  if (post.isLocalDraft()) {
    if (android.os.Build.VERSION.SDK_INT >= 14) {
      CharacterStyle[] characterStyles=postContentEditable.getSpans(0,postContentEditable.length(),CharacterStyle.class);
      for (      CharacterStyle characterStyle : characterStyles) {
        if (characterStyle.getClass().getName().equals("String_Node_Str"))         postContentEditable.removeSpan(characterStyle);
      }
    }
    content=WPHtml.toHtml(postContentEditable);
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str");
    content=content.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
 else {
    WPImageSpan[] imageSpans=postContentEditable.getSpans(0,postContentEditable.length(),WPImageSpan.class);
    if (imageSpans.length != 0) {
      for (      WPImageSpan wpIS : imageSpans) {
        MediaFile mediaFile=wpIS.getMediaFile();
        if (mediaFile == null)         continue;
        if (mediaFile.getMediaId() != null) {
          updateMediaFileOnServer(wpIS);
        }
 else {
          mediaFile.setFileName(wpIS.getImageSource().toString());
          mediaFile.setFilePath(wpIS.getImageSource().toString());
          mediaFile.save();
        }
        int tagStart=postContentEditable.getSpanStart(wpIS);
        if (!isAutoSave) {
          postContentEditable.removeSpan(wpIS);
          if (mediaFile.getMediaId() != null && mediaFile.getMediaId().length() > 0) {
            postContentEditable.insert(tagStart,WPHtml.getContent(wpIS));
          }
 else {
            postContentEditable.insert(tagStart,"String_Node_Str" + wpIS.getImageSource().toString() + "String_Node_Str");
          }
        }
      }
    }
    content=postContentEditable.toString();
  }
  if (!isAutoSave) {
    MediaGalleryImageSpan[] gallerySpans=postContentEditable.getSpans(0,postContentEditable.length(),MediaGalleryImageSpan.class);
    for (    MediaGalleryImageSpan gallerySpan : gallerySpans) {
      int start=postContentEditable.getSpanStart(gallerySpan);
      postContentEditable.removeSpan(gallerySpan);
      postContentEditable.insert(start,WPHtml.getGalleryShortcode(gallerySpan));
    }
  }
  String moreTag="String_Node_Str";
  post.setTitle(title);
  if (post.isLocalDraft() && content.contains(moreTag)) {
    post.setDescription(content.substring(0,content.indexOf(moreTag)));
    post.setMoreText(content.substring(content.indexOf(moreTag) + moreTag.length(),content.length()));
  }
 else {
    post.setDescription(content);
    post.setMoreText("String_Node_Str");
  }
  if (!post.isLocalDraft())   post.setLocalChange(true);
  WordPress.wpDB.updatePost(post);
}