Program: 32639
Project: 32639
Buggy source:
private void setListenersOnListView(final MonthYearAdapter adapter,final ListView listView,final AtomicBoolean listBeingTouched,final int mScrollStateOfListView,final ScrollState state){
  state.setScrollState(mScrollStateOfListView);
  listView.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          setOtherListViewsInvisible(listView);
          if (!adapter.getAllItemsVisible()) {
            listBeingTouched.set(true);
            adapter.setAllItemsVisible(true);
            adapter.highlightCurrentMonthColor(false);
            adapter.notifyDataSetChanged();
          }
 else           if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
            listBeingTouched.set(true);
            adapter.highlightCurrentMonthColor(false);
            adapter.notifyDataSetChanged();
          }
        }
 else         if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
          listBeingTouched.set(true);
        }
      }
      if (event.getAction() == MotionEvent.ACTION_UP) {
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          listBeingTouched.compareAndSet(true,false);
          adapter.highlightCurrentMonthColor(true);
          adapter.notifyDataSetChanged();
        }
 else         if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
          listBeingTouched.compareAndSet(true,false);
        }
      }
      return false;
    }
  }
);
  listView.setOnScrollListener(new OnScrollListener(){
    public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
    }
    public void onScrollStateChanged(    AbsListView view,    int scrollState){
      state.setScrollState(scrollState);
      if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
        listBeingTouched.set(true);
        putSomeRowInMiddle(listView,adapter);
      }
    }
  }
);
  listView.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> arg0,    View arg1,    int position,    long arg3){
      Log.d("String_Node_Str","String_Node_Str" + position);
    }
  }
);
}

Fixed version (ground truth):
private void setListenersOnListView(final MonthYearAdapter adapter,final ListView listView,final AtomicBoolean listBeingTouched,final int mScrollStateOfListView,final ScrollState state){
  state.setScrollState(mScrollStateOfListView);
  listView.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          setOtherListViewsInvisible(listView);
          if (!adapter.getAllItemsVisible()) {
            listBeingTouched.set(true);
            adapter.setAllItemsVisible(true);
            adapter.highlightCurrentMonthColor(false);
            adapter.notifyDataSetChanged();
          }
 else           if (adapter.getAllItemsVisible() && adapter.getHighlightCurrentMonth()) {
            listBeingTouched.set(true);
            adapter.highlightCurrentMonthColor(false);
            adapter.notifyDataSetChanged();
          }
        }
 else         if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
          listBeingTouched.set(true);
        }
      }
      if (event.getAction() == MotionEvent.ACTION_UP) {
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          listBeingTouched.compareAndSet(true,false);
          putThisViewInMiddle(event.getY(),listView);
          adapter.highlightCurrentMonthColor(true);
          adapter.notifyDataSetChanged();
        }
 else         if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
          listBeingTouched.compareAndSet(true,false);
        }
      }
      return false;
    }
  }
);
  listView.setOnScrollListener(new OnScrollListener(){
    public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
    }
    public void onScrollStateChanged(    AbsListView view,    int scrollState){
      state.setScrollState(scrollState);
      if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
        listBeingTouched.set(true);
        putSomeRowInMiddle(listView,adapter);
      }
    }
  }
);
  listView.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> arg0,    View arg1,    int position,    long arg3){
      Log.d("String_Node_Str","String_Node_Str" + position);
    }
  }
);
}