Program: 14746
Project: 14746
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Context context=container.getContext();
  final View view=inflater.inflate(R.layout.reader_fragment_post_list,container,false);
  mListView=(ListView)view.findViewById(android.R.id.list);
  mNewPostsBar=(TextView)view.findViewById(R.id.text_new_posts);
  mNewPostsBar.setVisibility(View.GONE);
  mNewPostsBar.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      reloadPosts(true);
      hideNewPostsBar();
    }
  }
);
  if (isFullScreenSupported()) {
    ReaderFullScreenUtils.addListViewHeader(context,mListView);
    final int actionbarHeight=DisplayUtils.getActionBarHeight(context);
    RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)mNewPostsBar.getLayoutParams();
    params.topMargin=actionbarHeight;
  }
  mEmptyView=view.findViewById(R.id.empty_view);
  mListView.setOnScrollListener(this);
  if (getPostListType() == ReaderPostListType.TAG) {
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> adapterView,      View view,      int position,      long id){
        if (mPostSelectedListener != null) {
          position-=mListView.getHeaderViewsCount();
          ReaderPost post=(ReaderPost)getPostAdapter().getItem(position);
          if (post != null)           mPostSelectedListener.onPostSelected(post.blogId,post.postId);
        }
      }
    }
);
  }
  mProgress=(ProgressBar)view.findViewById(R.id.progress_footer);
  mProgress.setVisibility(View.GONE);
  if (getPostListType() == ReaderPostListType.TAG) {
    mPullToRefreshHelper=new PullToRefreshHelper(getActivity(),(PullToRefreshLayout)view.findViewById(R.id.ptr_layout),new RefreshListener(){
      @Override public void onRefreshStarted(      View view){
        if (getActivity() == null || !NetworkUtils.checkConnection(getActivity())) {
          mPullToRefreshHelper.setRefreshing(false);
          return;
        }
        updatePostsWithCurrentTag(ReaderActions.RequestDataAction.LOAD_NEWER,RefreshType.MANUAL);
      }
    }
);
  }
  mListView.setAdapter(getPostAdapter());
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Context context=container.getContext();
  final View view=inflater.inflate(R.layout.reader_fragment_post_list,container,false);
  mListView=(ListView)view.findViewById(android.R.id.list);
  mNewPostsBar=(TextView)view.findViewById(R.id.text_new_posts);
  mNewPostsBar.setVisibility(View.GONE);
  mNewPostsBar.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      reloadPosts(true);
      hideNewPostsBar();
    }
  }
);
  if (isFullScreenSupported()) {
    ReaderFullScreenUtils.addListViewHeader(context,mListView);
    final int actionbarHeight=DisplayUtils.getActionBarHeight(context);
    RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)mNewPostsBar.getLayoutParams();
    params.topMargin=actionbarHeight;
  }
  mEmptyView=view.findViewById(R.id.empty_view);
  mListView.setOnScrollListener(this);
  if (getPostListType() == ReaderPostListType.TAG) {
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> adapterView,      View view,      int position,      long id){
        if (mPostSelectedListener != null) {
          position-=mListView.getHeaderViewsCount();
          ReaderPost post=(ReaderPost)getPostAdapter().getItem(position);
          if (post != null)           mPostSelectedListener.onPostSelected(post.blogId,post.postId);
        }
      }
    }
);
  }
  mProgress=(ProgressBar)view.findViewById(R.id.progress_footer);
  mProgress.setVisibility(View.GONE);
  if (getPostListType() == ReaderPostListType.TAG) {
    mPullToRefreshHelper=new PullToRefreshHelper(getActivity(),(PullToRefreshLayout)view.findViewById(R.id.ptr_layout),new RefreshListener(){
      @Override public void onRefreshStarted(      View view){
        if (getActivity() == null || !NetworkUtils.checkConnection(getActivity())) {
          mPullToRefreshHelper.setRefreshing(false);
          return;
        }
        updatePostsWithCurrentTag(ReaderActions.RequestDataAction.LOAD_NEWER,RefreshType.MANUAL);
      }
    }
);
  }
  return view;
}