Program: 14141
Project: 14141
Buggy source:
@Override public boolean onOptionsItemSelected(final MenuItem item){
  int itemId=item.getItemId();
  if (itemId == android.R.id.home) {
    Fragment fragment=getFragmentManager().findFragmentByTag(ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG);
    if (fragment != null && fragment.isVisible()) {
      return false;
    }
    if (mViewPager.getCurrentItem() > PAGE_CONTENT) {
      if (mViewPager.getCurrentItem() == PAGE_SETTINGS) {
        mPost.setFeaturedImageId(mEditPostSettingsFragment.getFeaturedImageId());
        mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId());
      }
      mViewPager.setCurrentItem(PAGE_CONTENT);
      invalidateOptionsMenu();
    }
 else {
      saveAndFinish();
    }
    return true;
  }
  MediaUploadService mediaUploadService=MediaUploadService.getInstance();
  if ((mediaUploadService != null && mediaUploadService.hasUploads()) || mEditorFragment.isUploadingMedia()) {
    ToastUtils.showToast(this,R.string.editor_toast_uploading_please_wait,Duration.SHORT);
    return false;
  }
  if (itemId == R.id.menu_save_post) {
    return savePost();
  }
 else   if (itemId == R.id.menu_preview_post) {
    mViewPager.setCurrentItem(PAGE_PREVIEW);
  }
 else   if (itemId == R.id.menu_post_settings) {
    InputMethodManager imm=((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE));
    imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(),0);
    if (mShowNewEditor) {
      mEditPostSettingsFragment.updateFeaturedImage(mPost.getFeaturedImageId());
    }
    mViewPager.setCurrentItem(PAGE_SETTINGS);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(final MenuItem item){
  int itemId=item.getItemId();
  if (itemId == android.R.id.home) {
    Fragment fragment=getFragmentManager().findFragmentByTag(ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG);
    if (fragment != null && fragment.isVisible()) {
      return false;
    }
    if (mViewPager.getCurrentItem() > PAGE_CONTENT) {
      if (mViewPager.getCurrentItem() == PAGE_SETTINGS) {
        mPost.setFeaturedImageId(mEditPostSettingsFragment.getFeaturedImageId());
        mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId());
      }
      mViewPager.setCurrentItem(PAGE_CONTENT);
      invalidateOptionsMenu();
    }
 else {
      saveAndFinish();
    }
    return true;
  }
  MediaUploadService mediaUploadService=MediaUploadService.getInstance();
  if ((mediaUploadService != null && mediaUploadService.hasUploads()) || mEditorFragment.isUploadingMedia()) {
    ToastUtils.showToast(this,R.string.editor_toast_uploading_please_wait,Duration.SHORT);
    return false;
  }
  if (itemId == R.id.menu_save_post) {
    return publishPost();
  }
 else   if (itemId == R.id.menu_preview_post) {
    mViewPager.setCurrentItem(PAGE_PREVIEW);
  }
 else   if (itemId == R.id.menu_post_settings) {
    InputMethodManager imm=((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE));
    imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(),0);
    if (mShowNewEditor) {
      mEditPostSettingsFragment.updateFeaturedImage(mPost.getFeaturedImageId());
    }
    mViewPager.setCurrentItem(PAGE_SETTINGS);
  }
  return false;
}