Program: 13406
Project: 13406
Buggy source:
@Override public boolean onOptionsItemSelected(final MenuItem item){
  int itemId=item.getItemId();
  if (itemId == android.R.id.home) {
    return handleBackPressed();
  }
  hidePhotoPicker();
  if (itemId == R.id.menu_save_post) {
    if (!AppPrefs.isAsyncPromoRequired()) {
      showPublishConfirmationOrUpdateIfNotLocalDraft();
    }
 else {
      showAsyncPromoDialog();
    }
  }
 else {
    if (!mShowAztecEditor && (mEditorFragment.isUploadingMedia() || mEditorFragment.isActionInProgress())) {
      ToastUtils.showToast(this,R.string.editor_toast_uploading_please_wait,Duration.SHORT);
      return false;
    }
    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 (mEditPostSettingsFragment != null) {
        mEditPostSettingsFragment.refreshViews();
      }
      mViewPager.setCurrentItem(PAGE_SETTINGS);
    }
 else     if (itemId == R.id.menu_save_as_draft_or_publish) {
      if (UploadService.hasInProgressMediaUploadsForPost(mPost)) {
        ToastUtils.showToast(EditPostActivity.this,getString(R.string.editor_toast_uploading_please_wait),Duration.SHORT);
        return false;
      }
      updatePostObject();
      if (PostStatus.fromPost(mPost) == PostStatus.DRAFT) {
        if (isDiscardable()) {
          String message=getString(mIsPage ? R.string.error_publish_empty_page : R.string.error_publish_empty_post);
          ToastUtils.showToast(EditPostActivity.this,message,Duration.SHORT);
          return false;
        }
        showPublishConfirmationDialog();
      }
 else {
        if (isDiscardable()) {
          ToastUtils.showToast(EditPostActivity.this,getString(R.string.error_save_empty_draft),Duration.SHORT);
          return false;
        }
        UploadUtils.showSnackbar(findViewById(R.id.editor_activity),R.string.editor_uploading_post);
        if (isNewPost()) {
          mPost.setStatus(PostStatus.DRAFT.toString());
        }
        savePostAndOptionallyFinish(false);
      }
    }
 else     if (itemId == R.id.menu_html_mode) {
      if (mEditorFragment instanceof AztecEditorFragment) {
        ((AztecEditorFragment)mEditorFragment).onToolbarHtmlButtonClicked();
        UploadUtils.showSnackbarSuccessActionOrange(findViewById(R.id.editor_activity),mHtmlModeMenuStateOn ? R.string.menu_html_mode_done_snackbar : R.string.menu_visual_mode_done_snackbar,R.string.menu_undo_snackbar_action,new View.OnClickListener(){
          @Override public void onClick(          View view){
            ((AztecEditorFragment)mEditorFragment).onToolbarHtmlButtonClicked();
          }
        }
);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(final MenuItem item){
  int itemId=item.getItemId();
  if (itemId == android.R.id.home) {
    return handleBackPressed();
  }
  hidePhotoPicker();
  if (itemId == R.id.menu_save_post) {
    if (AppPrefs.isAsyncPromoRequired() && PostStatus.fromPost(mPost) != PostStatus.DRAFT) {
      showAsyncPromoDialog();
    }
 else {
      showPublishConfirmationOrUpdateIfNotLocalDraft();
    }
  }
 else {
    if (!mShowAztecEditor && (mEditorFragment.isUploadingMedia() || mEditorFragment.isActionInProgress())) {
      ToastUtils.showToast(this,R.string.editor_toast_uploading_please_wait,Duration.SHORT);
      return false;
    }
    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 (mEditPostSettingsFragment != null) {
        mEditPostSettingsFragment.refreshViews();
      }
      mViewPager.setCurrentItem(PAGE_SETTINGS);
    }
 else     if (itemId == R.id.menu_save_as_draft_or_publish) {
      if (UploadService.hasInProgressMediaUploadsForPost(mPost)) {
        ToastUtils.showToast(EditPostActivity.this,getString(R.string.editor_toast_uploading_please_wait),Duration.SHORT);
        return false;
      }
      updatePostObject();
      if (PostStatus.fromPost(mPost) == PostStatus.DRAFT) {
        if (isDiscardable()) {
          String message=getString(mIsPage ? R.string.error_publish_empty_page : R.string.error_publish_empty_post);
          ToastUtils.showToast(EditPostActivity.this,message,Duration.SHORT);
          return false;
        }
        showPublishConfirmationDialog();
      }
 else {
        if (isDiscardable()) {
          ToastUtils.showToast(EditPostActivity.this,getString(R.string.error_save_empty_draft),Duration.SHORT);
          return false;
        }
        UploadUtils.showSnackbar(findViewById(R.id.editor_activity),R.string.editor_uploading_post);
        if (isNewPost()) {
          mPost.setStatus(PostStatus.DRAFT.toString());
        }
        savePostAndOptionallyFinish(false);
      }
    }
 else     if (itemId == R.id.menu_html_mode) {
      if (mEditorFragment instanceof AztecEditorFragment) {
        ((AztecEditorFragment)mEditorFragment).onToolbarHtmlButtonClicked();
        UploadUtils.showSnackbarSuccessActionOrange(findViewById(R.id.editor_activity),mHtmlModeMenuStateOn ? R.string.menu_html_mode_done_snackbar : R.string.menu_visual_mode_done_snackbar,R.string.menu_undo_snackbar_action,new View.OnClickListener(){
          @Override public void onClick(          View view){
            ((AztecEditorFragment)mEditorFragment).onToolbarHtmlButtonClicked();
          }
        }
);
      }
    }
  }
  return false;
}