Program: 14919
Project: 14919
Buggy source:
@Override public boolean onContextItemSelected(MenuItem item){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),mSelectedID,isPage);
  if (post.getId() < 0) {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.post_not_found));
      alert.show(ft,"String_Node_Str");
    }
    return false;
  }
  int itemGroupID=item.getGroupId();
  if (itemGroupID == MENU_GROUP_POSTS || itemGroupID == MENU_GROUP_PAGES || itemGroupID == MENU_GROUP_DRAFTS) {
switch (item.getItemId()) {
case MENU_ITEM_EDIT:
      WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedEdit);
    Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
  i2.putExtra(EditPostActivity.EXTRA_POSTID,mSelectedID);
if (itemGroupID == MENU_GROUP_PAGES) {
  i2.putExtra(EditPostActivity.EXTRA_IS_PAGE,true);
}
 else if (itemGroupID == MENU_GROUP_DRAFTS) {
  if (isPage)   i2.putExtra(EditPostActivity.EXTRA_IS_PAGE,true);
}
getActivity().startActivityForResult(i2,PostsActivity.ACTIVITY_EDIT_POST);
return true;
case MENU_ITEM_DELETE:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedDelete);
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case MENU_ITEM_PREVIEW:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedPreview);
Intent i=new Intent(getActivity(),PreviewPostActivity.class);
i.putExtra("String_Node_Str",itemGroupID == MENU_GROUP_PAGES ? true : false);
i.putExtra("String_Node_Str",mSelectedID);
i.putExtra("String_Node_Str",WordPress.currentBlog.getLocalTableBlogId());
startActivity(i);
return true;
case MENU_ITEM_SHARE:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedShare);
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
default :
return false;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean onContextItemSelected(MenuItem item){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),mSelectedID,isPage);
  if (post.getId() < 0) {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.post_not_found));
      ft.add(alert,"String_Node_Str");
      ft.commitAllowingStateLoss();
    }
    return false;
  }
  int itemGroupID=item.getGroupId();
  if (itemGroupID == MENU_GROUP_POSTS || itemGroupID == MENU_GROUP_PAGES || itemGroupID == MENU_GROUP_DRAFTS) {
switch (item.getItemId()) {
case MENU_ITEM_EDIT:
      WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedEdit);
    Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
  i2.putExtra(EditPostActivity.EXTRA_POSTID,mSelectedID);
if (itemGroupID == MENU_GROUP_PAGES) {
  i2.putExtra(EditPostActivity.EXTRA_IS_PAGE,true);
}
 else if (itemGroupID == MENU_GROUP_DRAFTS) {
  if (isPage)   i2.putExtra(EditPostActivity.EXTRA_IS_PAGE,true);
}
getActivity().startActivityForResult(i2,PostsActivity.ACTIVITY_EDIT_POST);
return true;
case MENU_ITEM_DELETE:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedDelete);
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case MENU_ITEM_PREVIEW:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedPreview);
Intent i=new Intent(getActivity(),PreviewPostActivity.class);
i.putExtra("String_Node_Str",itemGroupID == MENU_GROUP_PAGES ? true : false);
i.putExtra("String_Node_Str",mSelectedID);
i.putExtra("String_Node_Str",WordPress.currentBlog.getLocalTableBlogId());
startActivity(i);
return true;
case MENU_ITEM_SHARE:
WPMobileStatsUtil.flagProperty(statEventForViewClosing(),WPMobileStatsUtil.StatsPropertyPostMenuClickedShare);
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
default :
return false;
}
}
return false;
}