Program: 32645
Project: 32645
Buggy source:
private void setListenersOnListView(final MonthYearAdapter adapter,final ListView listView,final AtomicBoolean listBeingTouched,final ScrollState state,final ListViewVisible completeListVisible){
  state.setScrollState(OnScrollListener.SCROLL_STATE_IDLE);
  listView.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        disableOtherListViews(listView);
        Log.d("String_Node_Str","String_Node_Str");
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          stopOtherScrolls(listView);
          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) {
        enableAllListViews();
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          listBeingTouched.compareAndSet(true,false);
          adapter.highlightCurrentMonthColor(true);
          if (completeListVisible.isCompleteListViewVisible()) {
            putThisViewInMiddle(event.getY(),listView,adapter);
          }
 else {
            adapter.notifyDataSetChanged();
          }
          completeListVisible.setCompleteListViewVisible(true);
        }
 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){
    }
  }
);
}

Fixed version (ground truth):
private void setListenersOnListView(final MonthYearAdapter adapter,final ListView listView,final AtomicBoolean listBeingTouched,final ScrollState state,final ListViewVisible completeListVisible){
  state.setScrollState(OnScrollListener.SCROLL_STATE_IDLE);
  listView.setOnTouchListener(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_DOWN) {
        disableOtherListViews(listView);
        setOtherListViewsInvisible(listView);
        stopOtherScrolls(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();
        }
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          if (listView.getId() == R.id.date_listview) {
            addDatesInDateView();
          }
        }
 else         if (state.getScrollState() == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
          listBeingTouched.set(true);
        }
      }
      if (event.getAction() == MotionEvent.ACTION_UP) {
        enableAllListViews();
        listBeingTouched.compareAndSet(true,false);
        if (completeListVisible.isCompleteListViewVisible()) {
          putThisViewInMiddle(event.getY(),listView,adapter);
        }
        if (state.getScrollState() == OnScrollListener.SCROLL_STATE_IDLE) {
          adapter.highlightCurrentMonthColor(true);
          if (completeListVisible.isCompleteListViewVisible()) {
          }
 else {
            adapter.notifyDataSetChanged();
          }
          completeListVisible.setCompleteListViewVisible(true);
        }
      }
      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);
      Log.d("String_Node_Str","String_Node_Str" + scrollState);
      if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && !listBeingTouched.get()) {
        listBeingTouched.set(true);
        putSomeRowInMiddle(listView,adapter);
      }
    }
  }
);
}