Program: 14682
Project: 14682
Buggy source:
void updatePostsWithTag(final String tagName,final RequestDataAction updateAction,final RefreshType refreshType){
  if (TextUtils.isEmpty(tagName)) {
    return;
  }
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (refreshType == RefreshType.MANUAL && isCurrentTag(tagName)) {
    if (tagName.equals(ReaderTag.TAG_NAME_LIKED) || tagName.equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts();
  }
  ReaderActions.UpdateResultAndCountListener resultListener=new ReaderActions.UpdateResultAndCountListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result,    int numNewPosts){
      if (!hasActivity()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (!isCurrentTag(tagName)) {
        AppLog.i(T.READER,"String_Node_Str");
        return;
      }
      if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0) {
        if (!isPostAdapterEmpty() && getPostListType().equals(ReaderPostListType.TAG_FOLLOWED) && updateAction == RequestDataAction.LOAD_NEWER && !isListScrolledToTop()) {
          showNewPostsBar();
        }
 else {
          refreshPosts();
        }
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
;
  boolean allowBackfill=(updateAction == RequestDataAction.LOAD_NEWER && !isPostAdapterEmpty());
  if (allowBackfill) {
    ReaderActions.PostBackfillListener backfillListener=new ReaderActions.PostBackfillListener(){
      @Override public void onPostsBackfilled(      int numNewPosts){
        if (!hasActivity()) {
          AppLog.w(T.READER,"String_Node_Str");
          return;
        }
        if (!isCurrentTag(tagName)) {
          AppLog.i(T.READER,"String_Node_Str");
        }
 else         if (isPostAdapterEmpty()) {
          refreshPosts();
        }
      }
    }
;
    ReaderPostActions.updatePostsInTagWithBackfill(tagName,resultListener,backfillListener);
  }
 else {
    ReaderPostActions.updatePostsInTag(tagName,updateAction,resultListener);
  }
}

Fixed version (ground truth):
void updatePostsWithTag(final String tagName,final RequestDataAction updateAction,final RefreshType refreshType){
  if (TextUtils.isEmpty(tagName)) {
    return;
  }
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (getPostListType() == ReaderPostListType.TAG_FOLLOWED && ReaderTagTable.isEmpty()) {
    AppLog.d(T.READER,"String_Node_Str");
    return;
  }
  if (refreshType == RefreshType.MANUAL && isCurrentTag(tagName)) {
    if (tagName.equals(ReaderTag.TAG_NAME_LIKED) || tagName.equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts();
  }
  ReaderActions.UpdateResultAndCountListener resultListener=new ReaderActions.UpdateResultAndCountListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result,    int numNewPosts){
      if (!hasActivity()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (!isCurrentTag(tagName)) {
        AppLog.i(T.READER,"String_Node_Str");
        return;
      }
      if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0) {
        if (!isPostAdapterEmpty() && getPostListType().equals(ReaderPostListType.TAG_FOLLOWED) && updateAction == RequestDataAction.LOAD_NEWER && !isListScrolledToTop()) {
          showNewPostsBar();
        }
 else {
          refreshPosts();
        }
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
;
  boolean allowBackfill=(updateAction == RequestDataAction.LOAD_NEWER && !isPostAdapterEmpty());
  if (allowBackfill) {
    ReaderActions.PostBackfillListener backfillListener=new ReaderActions.PostBackfillListener(){
      @Override public void onPostsBackfilled(      int numNewPosts){
        if (!hasActivity()) {
          AppLog.w(T.READER,"String_Node_Str");
          return;
        }
        if (!isCurrentTag(tagName)) {
          AppLog.i(T.READER,"String_Node_Str");
        }
 else         if (isPostAdapterEmpty()) {
          refreshPosts();
        }
      }
    }
;
    ReaderPostActions.updatePostsInTagWithBackfill(tagName,resultListener,backfillListener);
  }
 else {
    ReaderPostActions.updatePostsInTag(tagName,updateAction,resultListener);
  }
}