Program: 164516
Project: 164516
Buggy source:
@Override protected void onPostCreate(Bundle savedInstanceState){
  super.onPostCreate(savedInstanceState);
  if (savedInstanceState == null) {
    mCommentSort=CommentSort.getSortFromString(app.getPreferences().getString(KEY_SORT,CommentSort.NEW.getSort()));
    mLoadComments=PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean(KEY_LOAD_COMMENTS,true);
    if (!TextUtils.isEmpty(mGalleryId)) {
      mApiClient=new ApiClient(String.format(Endpoints.GALLERY_ITEM_DETAILS.getUrl(),mGalleryId),ApiClient.HttpRequest.GET);
      mApiClient.doWork(ImgurBusEvent.EventType.GALLERY_ITEM_INFO,null,null);
      mGalleryId=null;
    }
 else {
      mViewPager.setAdapter(mPagerAdapter);
      if (mCurrentPosition == 0) {
        loadComments();
      }
 else {
        mViewPager.setCurrentItem(mCurrentPosition);
      }
    }
  }
 else {
    mCommentSort=CommentSort.getSortFromString(savedInstanceState.getString(KEY_SORT,CommentSort.NEW.getSort()));
    mLoadComments=savedInstanceState.getBoolean(KEY_LOAD_COMMENTS,true);
    mIsResuming=true;
    mCurrentPosition=savedInstanceState.getInt(KEY_POSITION,0);
    ArrayList<ImgurBaseObject> objects=savedInstanceState.getParcelableArrayList(KEY_OBJECTS);
    mPagerAdapter=new BrowsingAdapter(getFragmentManager(),objects);
    mViewPager.setAdapter(mPagerAdapter);
    mViewPager.setCurrentItem(mCurrentPosition);
    if (mSideGalleryFragment != null) {
      mSideGalleryFragment.addGalleryItems(objects);
    }
    List<ImgurComment> comments=savedInstanceState.getParcelableArrayList(KEY_COMMENT);
    if (comments != null) {
      mCommentAdapter=new CommentAdapter(getApplicationContext(),comments,this);
      mCommentList.setAdapter(mCommentAdapter);
    }
    if (mLoadComments) {
      mMultiView.setViewState(MultiStateView.ViewState.CONTENT);
    }
 else {
      mMultiView.setErrorText(R.id.errorMessage,R.string.comments_off);
      mMultiView.setViewState(MultiStateView.ViewState.ERROR);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostCreate(Bundle savedInstanceState){
  super.onPostCreate(savedInstanceState);
  if (savedInstanceState == null) {
    mCommentSort=CommentSort.getSortFromString(app.getPreferences().getString(KEY_SORT,CommentSort.NEW.getSort()));
    mLoadComments=PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean(KEY_LOAD_COMMENTS,true);
    if (!TextUtils.isEmpty(mGalleryId)) {
      mApiClient=new ApiClient(String.format(Endpoints.GALLERY_ITEM_DETAILS.getUrl(),mGalleryId),ApiClient.HttpRequest.GET);
      mApiClient.doWork(ImgurBusEvent.EventType.GALLERY_ITEM_INFO,null,null);
      mGalleryId=null;
    }
 else {
      mViewPager.setAdapter(mPagerAdapter);
      if (mCurrentPosition == 0) {
        loadComments();
      }
 else {
        mViewPager.setCurrentItem(mCurrentPosition);
      }
    }
  }
 else {
    mCommentSort=CommentSort.getSortFromString(savedInstanceState.getString(KEY_SORT,CommentSort.NEW.getSort()));
    mLoadComments=savedInstanceState.getBoolean(KEY_LOAD_COMMENTS,true);
    mIsResuming=true;
    mCurrentPosition=savedInstanceState.getInt(KEY_POSITION,0);
    ArrayList<ImgurBaseObject> objects=savedInstanceState.getParcelableArrayList(KEY_OBJECTS);
    mPagerAdapter=new BrowsingAdapter(getFragmentManager(),objects);
    mViewPager.setAdapter(mPagerAdapter);
    mViewPager.setCurrentItem(mCurrentPosition);
    if (mSideGalleryFragment != null) {
      mSideGalleryFragment.addGalleryItems(objects);
    }
    List<ImgurComment> comments=savedInstanceState.getParcelableArrayList(KEY_COMMENT);
    if (comments != null) {
      mCommentAdapter=new CommentAdapter(getApplicationContext(),comments,this);
      mCommentList.setAdapter(mCommentAdapter);
      mCommentList.removeHeaderView(mCommentListHeader);
    }
    if (mLoadComments) {
      mMultiView.setViewState(MultiStateView.ViewState.CONTENT);
    }
 else {
      mMultiView.setErrorText(R.id.errorMessage,R.string.comments_off);
      mMultiView.setViewState(MultiStateView.ViewState.ERROR);
    }
  }
}