Program: 13509
Project: 13509
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreateView(inflater,container,savedInstanceState);
  View view=inflater.inflate(R.layout.media_grid_fragment,container,false);
  mRecycler=(RecyclerView)view.findViewById(R.id.recycler);
  mRecycler.setHasFixedSize(true);
  int numColumns=MediaGridAdapter.getColumnCount(getActivity());
  mGridManager=new GridLayoutManager(getActivity(),numColumns);
  mRecycler.setLayoutManager(mGridManager);
  mRecycler.setAdapter(getAdapter());
  final int minDistance=WPMediaUtils.getFlingDistanceToDisableThumbLoading(getActivity());
  mRecycler.setOnFlingListener(new RecyclerView.OnFlingListener(){
    @Override public boolean onFling(    int velocityX,    int velocityY){
      if (Math.abs(velocityY) > minDistance) {
        getAdapter().setLoadThumbnails(false);
      }
      return false;
    }
  }
);
  mRecycler.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrollStateChanged(    RecyclerView recyclerView,    int newState){
      super.onScrollStateChanged(recyclerView,newState);
      if (newState == RecyclerView.SCROLL_STATE_IDLE) {
        getAdapter().setLoadThumbnails(true);
      }
    }
  }
);
  mEmptyView=(TextView)view.findViewById(R.id.empty_view);
  mSwipeToRefreshHelper=buildSwipeToRefreshHelper((CustomSwipeRefreshLayout)view.findViewById(R.id.ptr_layout),new RefreshListener(){
    @Override public void onRefreshStarted(){
      if (!isAdded()) {
        return;
      }
      if (!NetworkUtils.checkConnection(getActivity())) {
        updateEmptyView(EmptyViewMessageType.NETWORK_ERROR);
        setRefreshing(false);
        return;
      }
      fetchMediaList(false);
    }
  }
);
  if (savedInstanceState != null) {
    restoreState(savedInstanceState);
  }
  setFilter(mFilter);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  super.onCreateView(inflater,container,savedInstanceState);
  View view=inflater.inflate(R.layout.media_grid_fragment,container,false);
  mRecycler=view.findViewById(R.id.recycler);
  mRecycler.setHasFixedSize(true);
  int numColumns=MediaGridAdapter.getColumnCount(getActivity());
  mGridManager=new GridLayoutManager(getActivity(),numColumns);
  mRecycler.setLayoutManager(mGridManager);
  mRecycler.setAdapter(getAdapter());
  final int minDistance=WPMediaUtils.getFlingDistanceToDisableThumbLoading(getActivity());
  mRecycler.setOnFlingListener(new RecyclerView.OnFlingListener(){
    @Override public boolean onFling(    int velocityX,    int velocityY){
      if (Math.abs(velocityY) > minDistance) {
        getAdapter().setLoadThumbnails(false);
      }
      return false;
    }
  }
);
  mRecycler.addOnScrollListener(new RecyclerView.OnScrollListener(){
    @Override public void onScrollStateChanged(    RecyclerView recyclerView,    int newState){
      super.onScrollStateChanged(recyclerView,newState);
      if (newState == RecyclerView.SCROLL_STATE_IDLE) {
        getAdapter().setLoadThumbnails(true);
      }
    }
  }
);
  mEmptyView=(TextView)view.findViewById(R.id.empty_view);
  mRecycler.setEmptyView(mEmptyView);
  mSwipeToRefreshHelper=buildSwipeToRefreshHelper((CustomSwipeRefreshLayout)view.findViewById(R.id.ptr_layout),new RefreshListener(){
    @Override public void onRefreshStarted(){
      if (!isAdded()) {
        return;
      }
      if (!NetworkUtils.checkConnection(getActivity())) {
        updateEmptyView(EmptyViewMessageType.NETWORK_ERROR);
        setRefreshing(false);
        return;
      }
      fetchMediaList(false);
    }
  }
);
  if (savedInstanceState != null) {
    restoreState(savedInstanceState);
  }
  setFilter(mFilter);
  return view;
}