Program: 15170
Project: 15170
Buggy source:
@Override public boolean onContextItemSelected(MenuItem item){
  Post post=new Post(WordPress.currentBlog.getId(),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;
  }
  if (item.getGroupId() == 0) {
switch (item.getItemId()) {
case 0:
      Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
    i2.putExtra("String_Node_Str",mSelectedID);
  i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case 2:
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
case 3:
mOnPostActionListener.onPostAction(PostsActivity.POST_COMMENT,post);
return true;
}
}
 else if (item.getGroupId() == 2) {
switch (item.getItemId()) {
case 0:
Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
i2.putExtra("String_Node_Str",mSelectedID);
i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
i2.putExtra("String_Node_Str",true);
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case 2:
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
}
}
 else {
switch (item.getItemId()) {
case 0:
Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
i2.putExtra("String_Node_Str",mSelectedID);
i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
if (isPage) {
i2.putExtra("String_Node_Str",true);
}
i2.putExtra("String_Node_Str",true);
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean onContextItemSelected(MenuItem item){
  Post post=new Post(WordPress.currentBlog.getId(),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;
  }
  if (item.getGroupId() == 0) {
switch (item.getItemId()) {
case 0:
      Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
    i2.putExtra("String_Node_Str",mSelectedID);
  i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case 2:
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
case 3:
mOnPostActionListener.onPostAction(PostsActivity.POST_COMMENT,post);
return true;
}
}
 else if (item.getGroupId() == 2) {
switch (item.getItemId()) {
case 0:
Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
i2.putExtra("String_Node_Str",mSelectedID);
i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
i2.putExtra("String_Node_Str",true);
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
case 2:
mOnPostActionListener.onPostAction(PostsActivity.POST_SHARE,post);
return true;
case 3:
mOnPostActionListener.onPostAction(PostsActivity.POST_COMMENT,post);
return true;
}
}
 else {
switch (item.getItemId()) {
case 0:
Intent i2=new Intent(getActivity().getApplicationContext(),EditPostActivity.class);
i2.putExtra("String_Node_Str",mSelectedID);
i2.putExtra("String_Node_Str",WordPress.currentBlog.getId());
if (isPage) {
i2.putExtra("String_Node_Str",true);
}
i2.putExtra("String_Node_Str",true);
startActivityForResult(i2,0);
return true;
case 1:
mOnPostActionListener.onPostAction(PostsActivity.POST_DELETE,post);
return true;
}
}
return false;
}