Program: 14952
Project: 14952
Buggy source:
public void savePostContent(boolean isAutoSave){
  Post post=mActivity.getPost();
  if (post == null)   return;
  String title=(mTitleEditText.getText() != null) ? mTitleEditText.getText().toString() : "String_Node_Str";
  String content;
  if (post.isLocalDraft()) {
    Editable e=mContentEditText.getText();
    if (android.os.Build.VERSION.SDK_INT >= 14 && e != null) {
      CharacterStyle[] characterStyles=e.getSpans(0,e.length(),CharacterStyle.class);
      for (      CharacterStyle characterStyle : characterStyles) {
        if (characterStyle.getClass().getName().equals("String_Node_Str"))         e.removeSpan(characterStyle);
      }
    }
    content=WPHtml.toHtml(e);
    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 {
    content=(mContentEditText.getText() != null) ? mContentEditText.getText().toString() : "String_Node_Str";
  }
  String images="String_Node_Str";
  post.deleteMediaFiles();
  Editable s=mContentEditText.getText();
  if (!isAutoSave) {
    MediaGalleryImageSpan[] gallerySpans=s.getSpans(0,s.length(),MediaGalleryImageSpan.class);
    for (    MediaGalleryImageSpan gallerySpan : gallerySpans) {
      int start=s.getSpanStart(gallerySpan);
      s.removeSpan(gallerySpan);
      s.insert(start,WPHtml.getGalleryShortcode(gallerySpan));
    }
  }
  WPImageSpan[] imageSpans=s.getSpans(0,s.length(),WPImageSpan.class);
  if (imageSpans.length != 0) {
    for (    WPImageSpan wpIS : imageSpans) {
      images+=wpIS.getImageSource().toString() + "String_Node_Str";
      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=s.getSpanStart(wpIS);
      if (!isAutoSave) {
        s.removeSpan(wpIS);
        if (mediaFile.getMediaId() != null && mediaFile.getMediaId().length() > 0) {
          s.insert(tagStart,WPHtml.getContent(wpIS));
        }
 else {
          s.insert(tagStart,"String_Node_Str" + wpIS.getImageSource().toString() + "String_Node_Str");
        }
      }
    }
  }
  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");
  }
  post.setMediaPaths(images);
  if (!post.isLocalDraft())   post.setLocalChange(true);
  post.update();
}

Fixed version (ground truth):
public void savePostContent(boolean isAutoSave){
  Post post=mActivity.getPost();
  if (post == null)   return;
  String title=(mTitleEditText.getText() != null) ? mTitleEditText.getText().toString() : "String_Node_Str";
  String content;
  if (post.isLocalDraft()) {
    Editable e=mContentEditText.getText();
    if (android.os.Build.VERSION.SDK_INT >= 14 && e != null) {
      CharacterStyle[] characterStyles=e.getSpans(0,e.length(),CharacterStyle.class);
      for (      CharacterStyle characterStyle : characterStyles) {
        if (characterStyle.getClass().getName().equals("String_Node_Str"))         e.removeSpan(characterStyle);
      }
    }
    content=WPHtml.toHtml(e);
    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 {
    content=(mContentEditText.getText() != null) ? mContentEditText.getText().toString() : "String_Node_Str";
  }
  String images="String_Node_Str";
  post.deleteMediaFiles();
  Editable s=mContentEditText.getText();
  if (!isAutoSave) {
    MediaGalleryImageSpan[] gallerySpans=s.getSpans(0,s.length(),MediaGalleryImageSpan.class);
    for (    MediaGalleryImageSpan gallerySpan : gallerySpans) {
      int start=s.getSpanStart(gallerySpan);
      s.removeSpan(gallerySpan);
      s.insert(start,WPHtml.getGalleryShortcode(gallerySpan));
    }
  }
  WPImageSpan[] imageSpans=s.getSpans(0,s.length(),WPImageSpan.class);
  if (imageSpans.length != 0) {
    for (    WPImageSpan wpIS : imageSpans) {
      images+=wpIS.getImageSource().toString() + "String_Node_Str";
      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=s.getSpanStart(wpIS);
      if (!isAutoSave) {
        s.removeSpan(wpIS);
        if (mediaFile.getMediaId() != null && mediaFile.getMediaId().length() > 0) {
          s.insert(tagStart,WPHtml.getContent(wpIS));
        }
 else {
          s.insert(tagStart,"String_Node_Str" + wpIS.getImageSource().toString() + "String_Node_Str");
        }
      }
      if (post.isLocalDraft())       content=WPHtml.toHtml(s);
 else       content=s.toString();
    }
  }
  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");
  }
  post.setMediaPaths(images);
  if (!post.isLocalDraft())   post.setLocalChange(true);
  post.update();
}