Program: 14807
Project: 14807
Buggy source:
private void showCancelAlert(){
  if (mEditPostContentFragment != null && mEditPostContentFragment.hasEmptyContentFields()) {
    if (mIsNewPost)     mPost.delete();
    finish();
    return;
  }
  savePost(true);
  if (mOriginalPost != null && !mPost.hasChanges(mOriginalPost)) {
    mOriginalPost.update();
    WordPress.currentPost=mOriginalPost;
    finish();
    return;
  }
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(this);
  dialogBuilder.setTitle(getString((mPost.isPage()) ? R.string.edit_page : R.string.edit_post));
  dialogBuilder.setMessage(getString(R.string.prompt_save_changes));
  dialogBuilder.setPositiveButton(getResources().getText(R.string.save),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      savePost(false);
      WordPress.currentPost=mPost;
      Intent i=new Intent();
      i.putExtra("String_Node_Str",true);
      setResult(RESULT_OK,i);
      finish();
    }
  }
);
  dialogBuilder.setNeutralButton(getString(R.string.discard),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      if (mOriginalPost != null && !mIsNewPost) {
        mOriginalPost.update();
        WordPress.currentPost=mOriginalPost;
      }
 else       if (mPost != null && mIsNewPost) {
        mPost.delete();
      }
      finish();
    }
  }
);
  dialogBuilder.setNegativeButton(getString(R.string.cancel),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      dialog.dismiss();
    }
  }
);
  dialogBuilder.setCancelable(true);
  dialogBuilder.create().show();
}

Fixed version (ground truth):
private void showCancelAlert(){
  if (mEditPostContentFragment != null && mEditPostContentFragment.hasEmptyContentFields()) {
    if (mIsNewPost) {
      WordPress.wpDB.deletePost(mPost);
    }
    finish();
    return;
  }
  savePost(true);
  if (mOriginalPost != null && !mPost.hasChanges(mOriginalPost)) {
    WordPress.wpDB.updatePost(mOriginalPost);
    WordPress.currentPost=mOriginalPost;
    finish();
    return;
  }
  AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(this);
  dialogBuilder.setTitle(getString((mPost.isPage()) ? R.string.edit_page : R.string.edit_post));
  dialogBuilder.setMessage(getString(R.string.prompt_save_changes));
  dialogBuilder.setPositiveButton(getResources().getText(R.string.save),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      savePost(false);
      WordPress.currentPost=mPost;
      Intent i=new Intent();
      i.putExtra("String_Node_Str",true);
      setResult(RESULT_OK,i);
      finish();
    }
  }
);
  dialogBuilder.setNeutralButton(getString(R.string.discard),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      if (mOriginalPost != null && !mIsNewPost) {
        WordPress.wpDB.updatePost(mOriginalPost);
        WordPress.currentPost=mOriginalPost;
      }
 else       if (mPost != null && mIsNewPost) {
        WordPress.wpDB.deletePost(mPost);
      }
      finish();
    }
  }
);
  dialogBuilder.setNegativeButton(getString(R.string.cancel),new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      dialog.dismiss();
    }
  }
);
  dialogBuilder.setCancelable(true);
  dialogBuilder.create().show();
}