Program: 14543
Project: 14543
Buggy source:
public void requestPosts(boolean loadMore){
  if (!isAdded() || WordPress.getCurrentBlog() == null || mIsFetchingPosts)   return;
  if (!NetworkUtils.checkConnection(getActivity()))   return;
  int postCount=getPostListAdapter().getRemotePostCount() + POSTS_REQUEST_COUNT;
  if (!loadMore) {
    mCanLoadMorePosts=true;
    postCount=POSTS_REQUEST_COUNT;
  }
  List<Object> apiArgs=new Vector<Object>();
  apiArgs.add(WordPress.getCurrentBlog());
  apiArgs.add(mIsPage);
  apiArgs.add(postCount);
  apiArgs.add(loadMore);
  if (mProgressFooterView != null && loadMore) {
    mProgressFooterView.setVisibility(View.VISIBLE);
  }
  mCurrentFetchPostsTask=new ApiHelper.FetchPostsTask(new ApiHelper.FetchPostsTask.Callback(){
    @Override public void onSuccess(    int postCount){
      mCurrentFetchPostsTask=null;
      mIsFetchingPosts=false;
      if (!isAdded())       return;
      mPullToRefreshHelper.setRefreshing(false);
      if (mProgressFooterView != null) {
        mProgressFooterView.setVisibility(View.GONE);
      }
      if (postCount == 0) {
        mCanLoadMorePosts=false;
      }
 else       if (postCount == getPostListAdapter().getRemotePostCount() && postCount != POSTS_REQUEST_COUNT) {
        mCanLoadMorePosts=false;
      }
      getPostListAdapter().loadPosts();
    }
    @Override public void onFailure(    ApiHelper.ErrorType errorType,    String errorMessage,    Throwable throwable){
      mCurrentFetchPostsTask=null;
      mIsFetchingPosts=false;
      if (!isAdded()) {
        return;
      }
      mPullToRefreshHelper.setRefreshing(false);
      if (mProgressFooterView != null) {
        mProgressFooterView.setVisibility(View.GONE);
      }
      if (errorType != ErrorType.TASK_CANCELLED && errorType != ErrorType.NO_ERROR) {
switch (errorType) {
case UNAUTHORIZED:
          ToastUtils.showToast(getActivity(),mIsPage ? R.string.error_refresh_unauthorized_pages : R.string.error_refresh_unauthorized_posts,Duration.LONG);
        return;
default :
      ToastUtils.showToast(getActivity(),mIsPage ? R.string.error_refresh_pages : R.string.error_refresh_posts,Duration.LONG);
    return;
}
}
}
}
);
mIsFetchingPosts=true;
mCurrentFetchPostsTask.execute(apiArgs);
}

Fixed version (ground truth):
public void requestPosts(boolean loadMore){
  if (!isAdded() || WordPress.getCurrentBlog() == null || mIsFetchingPosts) {
    return;
  }
  if (!NetworkUtils.checkConnection(getActivity())) {
    mPullToRefreshHelper.setRefreshing(false);
    return;
  }
  int postCount=getPostListAdapter().getRemotePostCount() + POSTS_REQUEST_COUNT;
  if (!loadMore) {
    mCanLoadMorePosts=true;
    postCount=POSTS_REQUEST_COUNT;
  }
  List<Object> apiArgs=new Vector<Object>();
  apiArgs.add(WordPress.getCurrentBlog());
  apiArgs.add(mIsPage);
  apiArgs.add(postCount);
  apiArgs.add(loadMore);
  if (mProgressFooterView != null && loadMore) {
    mProgressFooterView.setVisibility(View.VISIBLE);
  }
  mCurrentFetchPostsTask=new ApiHelper.FetchPostsTask(new ApiHelper.FetchPostsTask.Callback(){
    @Override public void onSuccess(    int postCount){
      mCurrentFetchPostsTask=null;
      mIsFetchingPosts=false;
      if (!isAdded())       return;
      mPullToRefreshHelper.setRefreshing(false);
      if (mProgressFooterView != null) {
        mProgressFooterView.setVisibility(View.GONE);
      }
      if (postCount == 0) {
        mCanLoadMorePosts=false;
      }
 else       if (postCount == getPostListAdapter().getRemotePostCount() && postCount != POSTS_REQUEST_COUNT) {
        mCanLoadMorePosts=false;
      }
      getPostListAdapter().loadPosts();
    }
    @Override public void onFailure(    ApiHelper.ErrorType errorType,    String errorMessage,    Throwable throwable){
      mCurrentFetchPostsTask=null;
      mIsFetchingPosts=false;
      if (!isAdded()) {
        return;
      }
      mPullToRefreshHelper.setRefreshing(false);
      if (mProgressFooterView != null) {
        mProgressFooterView.setVisibility(View.GONE);
      }
      if (errorType != ErrorType.TASK_CANCELLED && errorType != ErrorType.NO_ERROR) {
switch (errorType) {
case UNAUTHORIZED:
          ToastUtils.showToast(getActivity(),mIsPage ? R.string.error_refresh_unauthorized_pages : R.string.error_refresh_unauthorized_posts,Duration.LONG);
        return;
default :
      ToastUtils.showToast(getActivity(),mIsPage ? R.string.error_refresh_pages : R.string.error_refresh_posts,Duration.LONG);
    return;
}
}
}
}
);
mIsFetchingPosts=true;
mCurrentFetchPostsTask.execute(apiArgs);
}