Program: 14961
Project: 14961
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mActivity=(NewEditPostActivity)getActivity();
  final ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.fragment_edit_post_content,container,false);
  mFormatBar=(RelativeLayout)rootView.findViewById(R.id.format_bar);
  mTitleEditText=(EditText)rootView.findViewById(R.id.post_title);
  mContentEditText=(WPEditText)rootView.findViewById(R.id.post_content);
  mBoldToggleButton=(ToggleButton)rootView.findViewById(R.id.bold);
  mEmToggleButton=(ToggleButton)rootView.findViewById(R.id.em);
  mBquoteToggleButton=(ToggleButton)rootView.findViewById(R.id.bquote);
  mUnderlineToggleButton=(ToggleButton)rootView.findViewById(R.id.underline);
  mStrikeToggleButton=(ToggleButton)rootView.findViewById(R.id.strike);
  mAddPictureButton=(ImageButton)rootView.findViewById(R.id.addPictureButton);
  Button linkButton=(Button)rootView.findViewById(R.id.link);
  Button moreButton=(Button)rootView.findViewById(R.id.more);
  registerForContextMenu(mAddPictureButton);
  mContentEditText.setOnSelectionChangedListener(this);
  mContentEditText.setOnTouchListener(this);
  mContentEditText.addTextChangedListener(this);
  mContentEditText.setOnEditTextImeBackListener(new WPEditText.EditTextImeBackListener(){
    @Override public void onImeBack(    WPEditText ctrl,    String text){
      if (!mActivity.getSupportActionBar().isShowing())       setContentEditingModeVisible(false);
    }
  }
);
  mAddPictureButton.setOnClickListener(mFormatBarButtonClickListener);
  mBoldToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  linkButton.setOnClickListener(mFormatBarButtonClickListener);
  mEmToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mUnderlineToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mStrikeToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mBquoteToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  moreButton.setOnClickListener(mFormatBarButtonClickListener);
  Post post=mActivity.getPost();
  if (post != null) {
    if (!TextUtils.isEmpty(post.getContent())) {
      if (post.isLocalDraft())       mContentEditText.setText(WPHtml.fromHtml(post.getContent().replaceAll("String_Node_Str","String_Node_Str"),mActivity,post));
 else       mContentEditText.setText(post.getContent().replaceAll("String_Node_Str","String_Node_Str"));
    }
    if (!TextUtils.isEmpty(post.getTitle())) {
      mTitleEditText.setText(post.getTitle());
    }
  }
  mContentEditText.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_UP && mActivity != null && mActivity.getSupportActionBar().isShowing()) {
        setContentEditingModeVisible(true);
      }
      return false;
    }
  }
);
  String action=mActivity.getIntent().getAction();
  int quickMediaType=-1;
  if (mActivity.getIntent().getExtras() != null)   quickMediaType=mActivity.getIntent().getExtras().getInt("String_Node_Str",-1);
  if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action))   setPostContentFromShareAction();
 else   if (NEW_MEDIA_GALLERY.equals(action))   prepareMediaGallery();
 else   if (NEW_MEDIA_POST.equals(action))   prepareMediaPost();
 else   if (quickMediaType >= 0) {
    if (quickMediaType == Constants.QUICK_POST_PHOTO_CAMERA)     launchCamera();
 else     if (quickMediaType == Constants.QUICK_POST_PHOTO_LIBRARY)     launchPictureLibrary();
 else     if (quickMediaType == Constants.QUICK_POST_VIDEO_CAMERA)     launchVideoCamera();
 else     if (quickMediaType == Constants.QUICK_POST_VIDEO_LIBRARY)     launchVideoLibrary();
    if (post != null) {
      if (quickMediaType == Constants.QUICK_POST_PHOTO_CAMERA || quickMediaType == Constants.QUICK_POST_PHOTO_LIBRARY)       post.setQuickPostType(Post.QUICK_MEDIA_TYPE_PHOTO);
 else       if (quickMediaType == Constants.QUICK_POST_VIDEO_CAMERA || quickMediaType == Constants.QUICK_POST_VIDEO_LIBRARY)       post.setQuickPostType(Post.QUICK_MEDIA_TYPE_VIDEO);
    }
  }
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mActivity=(NewEditPostActivity)getActivity();
  final ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.fragment_edit_post_content,container,false);
  mFormatBar=(RelativeLayout)rootView.findViewById(R.id.format_bar);
  mTitleEditText=(EditText)rootView.findViewById(R.id.post_title);
  mContentEditText=(WPEditText)rootView.findViewById(R.id.post_content);
  mBoldToggleButton=(ToggleButton)rootView.findViewById(R.id.bold);
  mEmToggleButton=(ToggleButton)rootView.findViewById(R.id.em);
  mBquoteToggleButton=(ToggleButton)rootView.findViewById(R.id.bquote);
  mUnderlineToggleButton=(ToggleButton)rootView.findViewById(R.id.underline);
  mStrikeToggleButton=(ToggleButton)rootView.findViewById(R.id.strike);
  mAddPictureButton=(ImageButton)rootView.findViewById(R.id.addPictureButton);
  Button linkButton=(Button)rootView.findViewById(R.id.link);
  Button moreButton=(Button)rootView.findViewById(R.id.more);
  registerForContextMenu(mAddPictureButton);
  mContentEditText.setOnSelectionChangedListener(this);
  mContentEditText.setOnTouchListener(this);
  mContentEditText.addTextChangedListener(this);
  mContentEditText.setOnEditTextImeBackListener(new WPEditText.EditTextImeBackListener(){
    @Override public void onImeBack(    WPEditText ctrl,    String text){
      if (mRootView.getBottom() < mOriginalViewBottom && !mActivity.getSupportActionBar().isShowing())       setContentEditingModeVisible(false);
    }
  }
);
  mAddPictureButton.setOnClickListener(mFormatBarButtonClickListener);
  mBoldToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  linkButton.setOnClickListener(mFormatBarButtonClickListener);
  mEmToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mUnderlineToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mStrikeToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  mBquoteToggleButton.setOnClickListener(mFormatBarButtonClickListener);
  moreButton.setOnClickListener(mFormatBarButtonClickListener);
  Post post=mActivity.getPost();
  if (post != null) {
    if (!TextUtils.isEmpty(post.getContent())) {
      if (post.isLocalDraft())       mContentEditText.setText(WPHtml.fromHtml(post.getContent().replaceAll("String_Node_Str","String_Node_Str"),mActivity,post));
 else       mContentEditText.setText(post.getContent().replaceAll("String_Node_Str","String_Node_Str"));
    }
    if (!TextUtils.isEmpty(post.getTitle())) {
      mTitleEditText.setText(post.getTitle());
    }
  }
  String action=mActivity.getIntent().getAction();
  int quickMediaType=-1;
  if (mActivity.getIntent().getExtras() != null)   quickMediaType=mActivity.getIntent().getExtras().getInt("String_Node_Str",-1);
  if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action))   setPostContentFromShareAction();
 else   if (NEW_MEDIA_GALLERY.equals(action))   prepareMediaGallery();
 else   if (NEW_MEDIA_POST.equals(action))   prepareMediaPost();
 else   if (quickMediaType >= 0) {
    if (quickMediaType == Constants.QUICK_POST_PHOTO_CAMERA)     launchCamera();
 else     if (quickMediaType == Constants.QUICK_POST_PHOTO_LIBRARY)     launchPictureLibrary();
 else     if (quickMediaType == Constants.QUICK_POST_VIDEO_CAMERA)     launchVideoCamera();
 else     if (quickMediaType == Constants.QUICK_POST_VIDEO_LIBRARY)     launchVideoLibrary();
    if (post != null) {
      if (quickMediaType == Constants.QUICK_POST_PHOTO_CAMERA || quickMediaType == Constants.QUICK_POST_PHOTO_LIBRARY)       post.setQuickPostType(Post.QUICK_MEDIA_TYPE_PHOTO);
 else       if (quickMediaType == Constants.QUICK_POST_VIDEO_CAMERA || quickMediaType == Constants.QUICK_POST_VIDEO_LIBRARY)       post.setQuickPostType(Post.QUICK_MEDIA_TYPE_VIDEO);
    }
  }
  return rootView;
}