nus-yam/ex-repair huggingface dataset:
Program: 19082
Project: 19082
Buggy source:
private void reloadSessionData(Cursor cursor){
  mSessionList.setAdapter(null);
  mSessionsAdapter=null;
  final ExploreSessionsModel model=new ExploreSessionsModel(cursor);
  if (model.getSessionData() == null || model.getSessionData().isEmpty()) {
    mEmptyView.setVisibility(View.VISIBLE);
    return;
  }
  final GridLayoutManager glm=(GridLayoutManager)mSessionList.getLayoutManager();
  mSessionsAdapter=SessionsAdapter.createVerticalGrid(getActivity(),model.getSessionData(),glm.getSpanCount());
  glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup(){
    @Override public int getSpanSize(    final int position){
      return mSessionsAdapter.getSpanSize(position);
    }
  }
);
  mSessionList.setAdapter(mSessionsAdapter);
  mEmptyView.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void reloadSessionData(Cursor cursor){
  mSessionList.setAdapter(null);
  mSessionsAdapter=null;
  final ExploreSessionsModel model=new ExploreSessionsModel(cursor,getActivity());
  if (model.getSessionData() == null || model.getSessionData().isEmpty()) {
    mEmptyView.setVisibility(View.VISIBLE);
    return;
  }
  final GridLayoutManager glm=(GridLayoutManager)mSessionList.getLayoutManager();
  mSessionsAdapter=SessionsAdapter.createVerticalGrid(getActivity(),model.getSessionData(),glm.getSpanCount());
  glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup(){
    @Override public int getSpanSize(    final int position){
      return mSessionsAdapter.getSpanSize(position);
    }
  }
);
  mSessionList.setAdapter(mSessionsAdapter);
  mEmptyView.setVisibility(View.GONE);
}
Program: 19083
Project: 19083
Buggy source:
public ExploreSessionsModel(Cursor cursor){
  if (cursor != null && cursor.moveToFirst()) {
    mSessionData=new ArrayList<>(cursor.getCount());
    do {
      mSessionData.add(createSessionData(cursor));
    }
 while (cursor.moveToNext());
  }
 else {
    mSessionData=null;
  }
}

Fixed version (ground truth):
public ExploreSessionsModel(Cursor cursor,Context context){
  mContext=context;
  if (cursor != null && cursor.moveToFirst()) {
    mSessionData=new ArrayList<>(cursor.getCount());
    do {
      mSessionData.add(createSessionData(cursor));
    }
 while (cursor.moveToNext());
  }
 else {
    mSessionData=null;
  }
}
Program: 19084
Project: 19084
Buggy source:
private SessionData createSessionData(Cursor cursor){
  return new SessionData(cursor.getString(ExploreSessionsQuery.TITLE),cursor.getString(ExploreSessionsQuery.ABSTRACT),cursor.getString(ExploreSessionsQuery.SESSION_ID),cursor.getString(ExploreSessionsQuery.PHOTO_URL),cursor.getString(ExploreSessionsQuery.MAIN_TAG),cursor.getLong(ExploreSessionsQuery.SESSION_START),cursor.getLong(ExploreSessionsQuery.SESSION_END),cursor.getString(ExploreSessionsQuery.LIVESTREAM_ID),cursor.getString(ExploreSessionsQuery.YOUTUBE_URL),cursor.getString(ExploreSessionsQuery.TAGS),cursor.getLong(ExploreSessionsQuery.IN_MY_SCHEDULE) == 1L);
}

Fixed version (ground truth):
private SessionData createSessionData(Cursor cursor){
  return new SessionData(mContext,cursor.getString(ExploreSessionsQuery.TITLE),cursor.getString(ExploreSessionsQuery.ABSTRACT),cursor.getString(ExploreSessionsQuery.SESSION_ID),cursor.getString(ExploreSessionsQuery.PHOTO_URL),cursor.getString(ExploreSessionsQuery.MAIN_TAG),cursor.getLong(ExploreSessionsQuery.SESSION_START),cursor.getLong(ExploreSessionsQuery.SESSION_END),cursor.getString(ExploreSessionsQuery.LIVESTREAM_ID),cursor.getString(ExploreSessionsQuery.YOUTUBE_URL),cursor.getString(ExploreSessionsQuery.TAGS),cursor.getLong(ExploreSessionsQuery.IN_MY_SCHEDULE) == 1L);
}
Program: 19085
Project: 19085
Buggy source:
private void bindCompactSession(CompactSessionViewHolder holder,final SessionData session){
  holder.footer.setText(TimeUtils.formatShortDateTime(mHost,session.getStartDate()));
}

Fixed version (ground truth):
private void bindCompactSession(CompactSessionViewHolder holder,final SessionData session){
  holder.footer.setText(TimeUtils.formatShortDateTime(mHost,session.getStartDate().getTime()));
}
Program: 19086
Project: 19086
Buggy source:
@Override public void onClick(final View v){
  final ViewGroup.LayoutParams lp=v.getLayoutParams();
  if (!(lp instanceof RecyclerView.LayoutParams))   return;
  final int position=((RecyclerView.LayoutParams)lp).getViewAdapterPosition();
  if (position == RecyclerView.NO_POSITION)   return;
  final SessionData sessionData=(SessionData)mItems.get(position);
  final Intent intent=new Intent(mHost,SessionDetailActivity.class);
  intent.setData(ScheduleContract.Sessions.buildSessionUri(sessionData.getSessionId()));
  ActivityCompat.startActivity(mHost,intent,null);
}

Fixed version (ground truth):
@Override public void onClick(final View v){
  final ViewGroup.LayoutParams lp=v.getLayoutParams();
  if (!(lp instanceof RecyclerView.LayoutParams)) {
    return;
  }
  final int position=((RecyclerView.LayoutParams)lp).getViewAdapterPosition();
  if (position == RecyclerView.NO_POSITION) {
    return;
  }
  final SessionData sessionData=(SessionData)mItems.get(position);
  final Intent intent=new Intent(mHost,SessionDetailActivity.class);
  intent.setData(ScheduleContract.Sessions.buildSessionUri(sessionData.getSessionId()));
  ActivityCompat.startActivity(mHost,intent,null);
}
Program: 19087
Project: 19087
Buggy source:
/** 
 * Process the given list of sessions. If we are in detail mode then insert day/time headers.
 */
private List processData(final List<SessionData> sessions){
  final List data=new ArrayList(sessions.size());
  Collections.sort(sessions,new Comparator<SessionData>(){
    @Override public int compare(    final SessionData lhs,    final SessionData rhs){
      return lhs.getStartDate().compareTo(rhs.getStartDate());
    }
  }
);
  if (mCompactMode) {
    data.addAll(sessions);
  }
 else {
    int day=-1, time=-1;
    for (    SessionData session : sessions) {
      if (session.getStartDate().getDate() > day) {
        day=session.getStartDate().getDate();
        data.add(new DayHeader(TimeUtils.formatShortDate(mHost,session.getStartDate())));
        time=-1;
      }
      if (session.getStartDate().getHours() > time) {
        time=session.getStartDate().getHours();
        data.add(new TimeHeader(TimeUtils.formatShortTime(mHost,session.getStartDate())));
      }
      data.add(session);
    }
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Process the given list of sessions. If we are in detail mode then insert day/time headers.
 */
private List processData(final List<SessionData> sessions){
  final List data=new ArrayList(sessions.size());
  Collections.sort(sessions,new Comparator<SessionData>(){
    @Override public int compare(    final SessionData lhs,    final SessionData rhs){
      return lhs.getStartDate().compareTo(rhs.getStartDate());
    }
  }
);
  if (mCompactMode) {
    data.addAll(sessions);
  }
 else {
    int day=-1, time=-1;
    for (    SessionData session : sessions) {
      if (session.getStartDate().get(Calendar.DAY_OF_YEAR) > day) {
        day=session.getStartDate().get(Calendar.DAY_OF_YEAR);
        data.add(new DayHeader(TimeUtils.formatShortDate(mHost,session.getStartDate().getTime())));
        time=-1;
      }
      if (session.getStartDate().get(Calendar.HOUR_OF_DAY) > time) {
        time=session.getStartDate().get(Calendar.HOUR_OF_DAY);
        data.add(new TimeHeader(TimeUtils.formatShortTime(mHost,session.getStartDate().getTime())));
      }
      data.add(session);
    }
  }
  return data;
}
Program: 19088
Project: 19088
Buggy source:
private void initPresenter(){
  MyScheduleModel model=ModelProvider.provideMyScheduleModel(new ScheduleHelper(this),this);
  if (mWideMode) {
    mPresenter=new PresenterImpl(model,(UpdatableView)getFragmentManager().findFragmentById(R.id.myScheduleWideFrag),MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
 else {
    MyScheduleSingleDayFragment[] fragments=mViewPagerAdapter.getFragments();
    UpdatableView[] views=new UpdatableView[fragments.length];
    for (int i=0; i < fragments.length; i++) {
      views[i]=fragments[i];
    }
    mPresenter=new PresenterImpl(model,views,MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
}

Fixed version (ground truth):
private void initPresenter(){
  MyScheduleModel model=ModelProvider.provideMyScheduleModel(new ScheduleHelper(this),this);
  if (mWideMode) {
    mPresenter=new PresenterImpl(model,(UpdatableView)getFragmentManager().findFragmentById(R.id.myScheduleWideFrag),MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
    mPresenter.loadInitialQueries();
  }
 else {
    MyScheduleSingleDayFragment[] fragments=mViewPagerAdapter.getFragments();
    UpdatableView[] views=new UpdatableView[fragments.length];
    for (int i=0; i < fragments.length; i++) {
      views[i]=fragments[i];
    }
    mPresenter=new PresenterImpl(model,views,MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
}
Program: 19089
Project: 19089
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  mDestroyed=true;
  mPresenter.cleanUp();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  mDestroyed=true;
}
Program: 19090
Project: 19090
Buggy source:
private void detectNarrowOrWideMode(){
  mWideMode=getFragmentManager().findFragmentById(R.id.myScheduleWideFrag) != null;
}

Fixed version (ground truth):
private void detectNarrowOrWideMode(){
  mWideMode=getFragmentManager().findFragmentById(R.id.myScheduleWideFrag) != null && findViewById(R.id.view_pager).getVisibility() == View.GONE;
}
Program: 19091
Project: 19091
Buggy source:
private void updateSchedule(MyScheduleModel model){
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    if (mPreConferenceDayView.getAdapter() == null) {
      mPreConferenceDayView.setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
    }
    mPreConferenceDayView.getAdapter().updateItems(model.getConferenceDataForDay(MyScheduleModel.PRE_CONFERENCE_DAY_ID));
  }
  for (int i=0; i < mMyScheduleSingleDayViews.length; i++) {
    if (mMyScheduleSingleDayViews[i].getAdapter() == null) {
      mMyScheduleSingleDayViews[i].setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
    }
    mMyScheduleSingleDayViews[i].getAdapter().updateItems(model.getConferenceDataForDay(i + 1));
  }
}

Fixed version (ground truth):
private void updateSchedule(MyScheduleModel model){
  if (isVisible()) {
    if (MyScheduleModel.showPreConferenceData(getContext())) {
      if (mPreConferenceDayView.getAdapter() == null) {
        mPreConferenceDayView.setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
      }
      mPreConferenceDayView.getAdapter().updateItems(model.getConferenceDataForDay(MyScheduleModel.PRE_CONFERENCE_DAY_ID));
    }
    for (int i=0; i < mMyScheduleSingleDayViews.length; i++) {
      if (mMyScheduleSingleDayViews[i].getAdapter() == null) {
        mMyScheduleSingleDayViews[i].setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
      }
      mMyScheduleSingleDayViews[i].getAdapter().updateItems(model.getConferenceDataForDay(i + 1));
    }
  }
}
Program: 19092
Project: 19092
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View root=inflater.inflate(R.layout.my_schedule_alldays_frag,container,false);
  mMyScheduleSingleDayViews[0]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_first_day);
  mMyScheduleSingleDayViews[1]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_second_day);
  return root;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View root=inflater.inflate(R.layout.my_schedule_alldays_frag,container,false);
  mMyScheduleSingleDayViews[0]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_first_day);
  mMyScheduleSingleDayViews[1]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_second_day);
  mMyScheduleSingleDayViews[2]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_third_day);
  setRetainInstance(false);
  return root;
}
Program: 19093
Project: 19093
Buggy source:
private void initViews(){
  TextView firstDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_first_day);
  TextView secondDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_second_day);
  if (firstDayHeaderView != null) {
    firstDayHeaderView.setText(TimeUtils.getDayName(getContext(),0));
  }
  if (secondDayHeaderView != null) {
    secondDayHeaderView.setText(TimeUtils.getDayName(getContext(),1));
  }
  mPreConferenceDayView=(MyScheduleSingleDayNoScrollView)getActivity().findViewById(R.id.my_schedule_zeroth_day);
  TextView zerothDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_zeroth_day);
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    mPreConferenceDayView.setVisibility(View.VISIBLE);
    zerothDayHeaderView.setText(TimeUtils.getDayName(getContext(),-1));
    zerothDayHeaderView.setVisibility(View.VISIBLE);
  }
 else {
    mPreConferenceDayView.setVisibility(View.GONE);
    zerothDayHeaderView.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void initViews(){
  TextView firstDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_first_day);
  TextView secondDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_second_day);
  TextView thirdDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_third_day);
  if (firstDayHeaderView != null) {
    firstDayHeaderView.setText(TimeUtils.getDayName(getContext(),0));
  }
  if (secondDayHeaderView != null) {
    secondDayHeaderView.setText(TimeUtils.getDayName(getContext(),1));
  }
  if (thirdDayHeaderView != null) {
    thirdDayHeaderView.setText(TimeUtils.getDayName(getContext(),2));
  }
  mPreConferenceDayView=(MyScheduleSingleDayNoScrollView)getActivity().findViewById(R.id.my_schedule_zeroth_day);
  TextView zerothDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_zeroth_day);
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    mPreConferenceDayView.setVisibility(View.VISIBLE);
    zerothDayHeaderView.setText(TimeUtils.getDayName(getContext(),-1));
    zerothDayHeaderView.setVisibility(View.VISIBLE);
  }
 else {
    mPreConferenceDayView.setVisibility(View.GONE);
    zerothDayHeaderView.setVisibility(View.GONE);
  }
}
Program: 19094
Project: 19094
Buggy source:
private void initPresenter(){
  MyScheduleModel model=ModelProvider.provideMyScheduleModel(new ScheduleHelper(this),this);
  if (mWideMode) {
    mPresenter=new PresenterImpl(model,(UpdatableView)getFragmentManager().findFragmentById(R.id.myScheduleWideFrag),MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
 else {
    MyScheduleSingleDayFragment[] fragments=mViewPagerAdapter.getFragments();
    UpdatableView[] views=new UpdatableView[fragments.length];
    for (int i=0; i < fragments.length; i++) {
      views[i]=fragments[i];
    }
    mPresenter=new PresenterImpl(model,views,MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
}

Fixed version (ground truth):
private void initPresenter(){
  MyScheduleModel model=ModelProvider.provideMyScheduleModel(new ScheduleHelper(this),this);
  if (mWideMode) {
    mPresenter=new PresenterImpl(model,(UpdatableView)getFragmentManager().findFragmentById(R.id.myScheduleWideFrag),MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
    mPresenter.loadInitialQueries();
  }
 else {
    MyScheduleSingleDayFragment[] fragments=mViewPagerAdapter.getFragments();
    UpdatableView[] views=new UpdatableView[fragments.length];
    for (int i=0; i < fragments.length; i++) {
      views[i]=fragments[i];
    }
    mPresenter=new PresenterImpl(model,views,MyScheduleModel.MyScheduleUserActionEnum.values(),MyScheduleModel.MyScheduleQueryEnum.values());
  }
}
Program: 19095
Project: 19095
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  mDestroyed=true;
  mPresenter.cleanUp();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  mDestroyed=true;
}
Program: 19096
Project: 19096
Buggy source:
private void detectNarrowOrWideMode(){
  mWideMode=getFragmentManager().findFragmentById(R.id.myScheduleWideFrag) != null;
}

Fixed version (ground truth):
private void detectNarrowOrWideMode(){
  mWideMode=getFragmentManager().findFragmentById(R.id.myScheduleWideFrag) != null && findViewById(R.id.view_pager).getVisibility() == View.GONE;
}
Program: 19097
Project: 19097
Buggy source:
private void updateSchedule(MyScheduleModel model){
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    if (mPreConferenceDayView.getAdapter() == null) {
      mPreConferenceDayView.setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
    }
    mPreConferenceDayView.getAdapter().updateItems(model.getConferenceDataForDay(MyScheduleModel.PRE_CONFERENCE_DAY_ID));
  }
  for (int i=0; i < mMyScheduleSingleDayViews.length; i++) {
    if (mMyScheduleSingleDayViews[i].getAdapter() == null) {
      mMyScheduleSingleDayViews[i].setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
    }
    mMyScheduleSingleDayViews[i].getAdapter().updateItems(model.getConferenceDataForDay(i + 1));
  }
}

Fixed version (ground truth):
private void updateSchedule(MyScheduleModel model){
  if (isVisible()) {
    if (MyScheduleModel.showPreConferenceData(getContext())) {
      if (mPreConferenceDayView.getAdapter() == null) {
        mPreConferenceDayView.setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
      }
      mPreConferenceDayView.getAdapter().updateItems(model.getConferenceDataForDay(MyScheduleModel.PRE_CONFERENCE_DAY_ID));
    }
    for (int i=0; i < mMyScheduleSingleDayViews.length; i++) {
      if (mMyScheduleSingleDayViews[i].getAdapter() == null) {
        mMyScheduleSingleDayViews[i].setAdapter(new MyScheduleDayAdapter(getActivity(),((MyScheduleActivity)getActivity()).getLUtils(),mListener));
      }
      mMyScheduleSingleDayViews[i].getAdapter().updateItems(model.getConferenceDataForDay(i + 1));
    }
  }
}
Program: 19098
Project: 19098
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View root=inflater.inflate(R.layout.my_schedule_alldays_frag,container,false);
  mMyScheduleSingleDayViews[0]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_first_day);
  mMyScheduleSingleDayViews[1]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_second_day);
  return root;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View root=inflater.inflate(R.layout.my_schedule_alldays_frag,container,false);
  mMyScheduleSingleDayViews[0]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_first_day);
  mMyScheduleSingleDayViews[1]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_second_day);
  mMyScheduleSingleDayViews[2]=(MyScheduleSingleDayNoScrollView)root.findViewById(R.id.my_schedule_third_day);
  setRetainInstance(false);
  return root;
}
Program: 19099
Project: 19099
Buggy source:
private void initViews(){
  TextView firstDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_first_day);
  TextView secondDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_second_day);
  if (firstDayHeaderView != null) {
    firstDayHeaderView.setText(TimeUtils.getDayName(getContext(),0));
  }
  if (secondDayHeaderView != null) {
    secondDayHeaderView.setText(TimeUtils.getDayName(getContext(),1));
  }
  mPreConferenceDayView=(MyScheduleSingleDayNoScrollView)getActivity().findViewById(R.id.my_schedule_zeroth_day);
  TextView zerothDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_zeroth_day);
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    mPreConferenceDayView.setVisibility(View.VISIBLE);
    zerothDayHeaderView.setText(TimeUtils.getDayName(getContext(),-1));
    zerothDayHeaderView.setVisibility(View.VISIBLE);
  }
 else {
    mPreConferenceDayView.setVisibility(View.GONE);
    zerothDayHeaderView.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void initViews(){
  TextView firstDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_first_day);
  TextView secondDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_second_day);
  TextView thirdDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_third_day);
  if (firstDayHeaderView != null) {
    firstDayHeaderView.setText(TimeUtils.getDayName(getContext(),0));
  }
  if (secondDayHeaderView != null) {
    secondDayHeaderView.setText(TimeUtils.getDayName(getContext(),1));
  }
  if (thirdDayHeaderView != null) {
    thirdDayHeaderView.setText(TimeUtils.getDayName(getContext(),2));
  }
  mPreConferenceDayView=(MyScheduleSingleDayNoScrollView)getActivity().findViewById(R.id.my_schedule_zeroth_day);
  TextView zerothDayHeaderView=(TextView)getActivity().findViewById(R.id.day_label_zeroth_day);
  if (MyScheduleModel.showPreConferenceData(getContext())) {
    mPreConferenceDayView.setVisibility(View.VISIBLE);
    zerothDayHeaderView.setText(TimeUtils.getDayName(getContext(),-1));
    zerothDayHeaderView.setVisibility(View.VISIBLE);
  }
 else {
    mPreConferenceDayView.setVisibility(View.GONE);
    zerothDayHeaderView.setVisibility(View.GONE);
  }
}
Program: 19100
Project: 19100
Buggy source:
@Override public void onStatusChanged(int which){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
      if (TextUtils.isEmpty(accountName)) {
        onRefreshingStateChanged(false);
        mManualSyncRequest=false;
        return;
      }
      Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
      boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
      boolean syncPending=ContentResolver.isSyncPending(account,ScheduleContract.CONTENT_AUTHORITY);
      if (!syncActive && !syncPending) {
        mManualSyncRequest=false;
      }
      onRefreshingStateChanged(syncActive || mManualSyncRequest);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onStatusChanged(int which){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
      if (TextUtils.isEmpty(accountName)) {
        onRefreshingStateChanged(false);
        return;
      }
      Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
      boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
      onRefreshingStateChanged(syncActive);
    }
  }
);
}
Program: 19101
Project: 19101
Buggy source:
@Override public void run(){
  String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
  if (TextUtils.isEmpty(accountName)) {
    onRefreshingStateChanged(false);
    mManualSyncRequest=false;
    return;
  }
  Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
  boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
  boolean syncPending=ContentResolver.isSyncPending(account,ScheduleContract.CONTENT_AUTHORITY);
  if (!syncActive && !syncPending) {
    mManualSyncRequest=false;
  }
  onRefreshingStateChanged(syncActive || mManualSyncRequest);
}

Fixed version (ground truth):
@Override public void run(){
  String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
  if (TextUtils.isEmpty(accountName)) {
    onRefreshingStateChanged(false);
    return;
  }
  Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
  boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
  onRefreshingStateChanged(syncActive);
}
Program: 19102
Project: 19102
Buggy source:
protected void requestDataRefresh(){
  Account activeAccount=AccountUtils.getActiveAccount(this);
  ContentResolver contentResolver=getContentResolver();
  if (contentResolver.isSyncActive(activeAccount,ScheduleContract.CONTENT_AUTHORITY)) {
    LOGD(TAG,"String_Node_Str");
    return;
  }
  mManualSyncRequest=true;
  LOGD(TAG,"String_Node_Str");
  SyncHelper.requestManualSync(activeAccount);
}

Fixed version (ground truth):
protected void requestDataRefresh(){
  Account activeAccount=AccountUtils.getActiveAccount(this);
  ContentResolver contentResolver=getContentResolver();
  if (contentResolver.isSyncActive(activeAccount,ScheduleContract.CONTENT_AUTHORITY)) {
    LOGD(TAG,"String_Node_Str");
    return;
  }
  LOGD(TAG,"String_Node_Str");
  SyncHelper.requestManualSync(activeAccount);
}
Program: 19104
Project: 19104
Buggy source:
public VideoThumbnail(final Context context,final AttributeSet attrs,final int defStyleAttr){
  super(context,attrs,defStyleAttr);
  final TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.VideoThumbnail,defStyleAttr,0);
  mPlayIcon=a.getDrawable(R.styleable.VideoThumbnail_playIcon);
  a.recycle();
  setScaleType(ScaleType.CENTER_CROP);
}

Fixed version (ground truth):
public VideoThumbnail(final Context context,final AttributeSet attrs,final int defStyleAttr){
  super(context,attrs,defStyleAttr);
  final TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.VideoThumbnail,defStyleAttr,0);
  mPlayIcon=a.getDrawable(R.styleable.VideoThumbnail_playIcon);
  mPlayedTint=a.getColor(R.styleable.VideoThumbnail_playedTint,Color.TRANSPARENT);
  a.recycle();
  setScaleType(ScaleType.CENTER_CROP);
}
Program: 19105
Project: 19105
Buggy source:
public void setPlayed(final boolean played){
  if (mIsPlayed != played) {
    mIsPlayed=played;
    refreshDrawableState();
    invalidate();
  }
}

Fixed version (ground truth):
public void setPlayed(final boolean played){
  if (mIsPlayed != played) {
    mIsPlayed=played;
    if (played) {
      setColorFilter(mPlayedTint);
    }
 else {
      clearColorFilter();
    }
    invalidate();
  }
}
Program: 19106
Project: 19106
Buggy source:
@Override public void displayData(final VideoLibraryModel model,final VideoLibraryQueryEnum query){
  if ((VideoLibraryModel.VideoLibraryQueryEnum.VIDEOS == query || VideoLibraryModel.VideoLibraryQueryEnum.MY_VIEWED_VIDEOS == query) && model.hasVideos()) {
    if (mAdapter == null) {
      mAdapter=new VideosAdapter(getActivity(),model,mImageLoader,mListeners);
      mCardList.setAdapter(mAdapter);
    }
 else {
      mAdapter.update(model);
    }
    mEmptyView.setVisibility(View.GONE);
  }
 else {
    mEmptyView.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
@Override public void displayData(final VideoLibraryModel model,final VideoLibraryQueryEnum query){
  if ((VideoLibraryModel.VideoLibraryQueryEnum.VIDEOS == query || VideoLibraryModel.VideoLibraryQueryEnum.MY_VIEWED_VIDEOS == query) && model.hasVideos()) {
    if (mAdapter == null) {
      mAdapter=new VideosAdapter(getActivity(),model,mImageLoader,mListeners);
      mCardList.setAdapter(mAdapter);
    }
 else {
      mAdapter.update(model);
    }
  }
  mEmptyView.setVisibility((mAdapter != null && mAdapter.getItemCount() > 0) ? View.GONE : View.VISIBLE);
}
Program: 19107
Project: 19107
Buggy source:
/** 
 * Get the list of   {@link MessageData} to be displayed to the user,based upon time, location etc.
 * @return messages to be displayed.
 */
public List<MessageData> getMessages(){
  final List<MessageData> messages=new ArrayList<>();
  if (SettingsUtils.isAttendeeAtVenue(mContext)) {
    if (!ConfMessageCardUtils.hasAnsweredConfMessageCardsPrompt(mContext)) {
      messages.add(MessageCardHelper.getConferenceOptInMessageData(mContext));
    }
 else     if (ConfMessageCardUtils.isConfMessageCardsEnabled(mContext)) {
      ConfMessageCardUtils.enableActiveCards(mContext);
      if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.CONFERENCE_CREDENTIALS)) {
        messages.add(MessageCardHelper.getConferenceCredentialsMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.KEYNOTE_ACCESS)) {
        messages.add(MessageCardHelper.getKeynoteAccessMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.AFTER_HOURS)) {
        messages.add(MessageCardHelper.getAfterHoursMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.WIFI_FEEDBACK)) {
        if (WiFiUtils.isWiFiEnabled(mContext) && WiFiUtils.isWiFiApConfigured(mContext)) {
          messages.add(MessageCardHelper.getWifiFeedbackMessageData(mContext));
        }
      }
    }
    if (WiFiUtils.shouldOfferToSetupWifi(mContext,true)) {
      messages.add(MessageCardHelper.getWifiSetupMessageData(mContext));
    }
  }
  return messages;
}

Fixed version (ground truth):
/** 
 * Get the list of   {@link MessageData} to be displayed to the user, based upon time, locationetc.
 * @return messages to be displayed.
 */
public List<MessageData> getMessages(){
  final List<MessageData> messages=new ArrayList<>();
  if (SettingsUtils.isAttendeeAtVenue(mContext)) {
    if (!ConfMessageCardUtils.hasAnsweredConfMessageCardsPrompt(mContext)) {
      messages.add(MessageCardHelper.getConferenceOptInMessageData(mContext));
    }
 else     if (ConfMessageCardUtils.isConfMessageCardsEnabled(mContext)) {
      ConfMessageCardUtils.enableActiveCards(mContext);
      if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.CONFERENCE_CREDENTIALS)) {
        messages.add(MessageCardHelper.getConferenceCredentialsMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.KEYNOTE_ACCESS)) {
        messages.add(MessageCardHelper.getKeynoteAccessMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.AFTER_HOURS)) {
        messages.add(MessageCardHelper.getAfterHoursMessageData(mContext));
      }
 else       if (shouldShowCard(ConfMessageCardUtils.ConfMessageCard.WIFI_FEEDBACK)) {
        if (WiFiUtils.isWiFiEnabled(mContext) && WiFiUtils.isWiFiApConfigured(mContext)) {
          messages.add(MessageCardHelper.getWifiFeedbackMessageData(mContext));
        }
      }
    }
    if (WiFiUtils.shouldOfferToSetupWifi(mContext,true)) {
      messages.add(MessageCardHelper.getWifiSetupMessageData(mContext));
    }
  }
  return messages;
}
Program: 19108
Project: 19108
Buggy source:
private void populateSessionFromCursorRow(SessionData session,Cursor cursor){
  session.updateData(cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_TITLE)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_ABSTRACT)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_ID)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_PHOTO_URL)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_MAIN_TAG)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_START)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_END)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_LIVESTREAM_ID)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_YOUTUBE_URL)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_TAGS)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_IN_MY_SCHEDULE)) == 1L);
}

Fixed version (ground truth):
private void populateSessionFromCursorRow(SessionData session,Cursor cursor){
  session.updateData(mContext,cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_TITLE)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_ABSTRACT)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_ID)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_PHOTO_URL)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_MAIN_TAG)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_START)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_END)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_LIVESTREAM_ID)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_YOUTUBE_URL)),cursor.getString(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_TAGS)),cursor.getLong(cursor.getColumnIndex(ScheduleContract.Sessions.SESSION_IN_MY_SCHEDULE)) == 1L);
}
Program: 19109
Project: 19109
Buggy source:
private void rewriteKeynoteDetails(SessionData keynoteData){
  long startTime, endTime, currentTime;
  currentTime=TimeUtils.getCurrentTime(mContext);
  if (keynoteData.getStartDate() != null) {
    startTime=keynoteData.getStartDate().getTime();
  }
 else {
    LOGD(TAG,"String_Node_Str");
    startTime=0;
  }
  if (keynoteData.getEndDate() != null) {
    endTime=keynoteData.getEndDate().getTime();
  }
 else {
    LOGD(TAG,"String_Node_Str");
    endTime=Long.MAX_VALUE;
  }
  StringBuilder stringBuilder=new StringBuilder();
  if (currentTime >= startTime && currentTime < endTime) {
    stringBuilder.append(mContext.getString(R.string.live_now));
  }
 else {
    stringBuilder.append(TimeUtils.formatShortDateTime(mContext,keynoteData.getStartDate()));
  }
  keynoteData.setDetails(stringBuilder.toString());
}

Fixed version (ground truth):
private void rewriteKeynoteDetails(SessionData keynoteData){
  long startTime, endTime, currentTime;
  currentTime=TimeUtils.getCurrentTime(mContext);
  if (keynoteData.getStartDate() != null) {
    startTime=keynoteData.getStartDate().getTimeInMillis();
  }
 else {
    LOGD(TAG,"String_Node_Str");
    startTime=0;
  }
  if (keynoteData.getEndDate() != null) {
    endTime=keynoteData.getEndDate().getTimeInMillis();
  }
 else {
    LOGD(TAG,"String_Node_Str");
    endTime=Long.MAX_VALUE;
  }
  StringBuilder stringBuilder=new StringBuilder();
  if (currentTime >= startTime && currentTime < endTime) {
    stringBuilder.append(mContext.getString(R.string.live_now));
  }
 else {
    stringBuilder.append(TimeUtils.formatShortDateTime(mContext,keynoteData.getStartDate().getTime()));
  }
  keynoteData.setDetails(stringBuilder.toString());
}
Program: 19110
Project: 19110
Buggy source:
private void reloadSessionData(Cursor cursor){
  mSessionList.setAdapter(null);
  mSessionsAdapter=null;
  final ExploreSessionsModel model=new ExploreSessionsModel(cursor);
  if (model.getSessionData() == null || model.getSessionData().isEmpty()) {
    mEmptyView.setVisibility(View.VISIBLE);
    return;
  }
  final GridLayoutManager glm=(GridLayoutManager)mSessionList.getLayoutManager();
  mSessionsAdapter=SessionsAdapter.createVerticalGrid(getActivity(),model.getSessionData(),glm.getSpanCount());
  glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup(){
    @Override public int getSpanSize(    final int position){
      return mSessionsAdapter.getSpanSize(position);
    }
  }
);
  mSessionList.setAdapter(mSessionsAdapter);
  mEmptyView.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void reloadSessionData(Cursor cursor){
  mSessionList.setAdapter(null);
  mSessionsAdapter=null;
  final ExploreSessionsModel model=new ExploreSessionsModel(cursor,getActivity());
  if (model.getSessionData() == null || model.getSessionData().isEmpty()) {
    mEmptyView.setVisibility(View.VISIBLE);
    return;
  }
  final GridLayoutManager glm=(GridLayoutManager)mSessionList.getLayoutManager();
  mSessionsAdapter=SessionsAdapter.createVerticalGrid(getActivity(),model.getSessionData(),glm.getSpanCount());
  glm.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup(){
    @Override public int getSpanSize(    final int position){
      return mSessionsAdapter.getSpanSize(position);
    }
  }
);
  mSessionList.setAdapter(mSessionsAdapter);
  mEmptyView.setVisibility(View.GONE);
}
Program: 19111
Project: 19111
Buggy source:
public ExploreSessionsModel(Cursor cursor){
  if (cursor != null && cursor.moveToFirst()) {
    mSessionData=new ArrayList<>(cursor.getCount());
    do {
      mSessionData.add(createSessionData(cursor));
    }
 while (cursor.moveToNext());
  }
 else {
    mSessionData=null;
  }
}

Fixed version (ground truth):
public ExploreSessionsModel(Cursor cursor,Context context){
  mContext=context;
  if (cursor != null && cursor.moveToFirst()) {
    mSessionData=new ArrayList<>(cursor.getCount());
    do {
      mSessionData.add(createSessionData(cursor));
    }
 while (cursor.moveToNext());
  }
 else {
    mSessionData=null;
  }
}
Program: 19112
Project: 19112
Buggy source:
private SessionData createSessionData(Cursor cursor){
  return new SessionData(cursor.getString(ExploreSessionsQuery.TITLE),cursor.getString(ExploreSessionsQuery.ABSTRACT),cursor.getString(ExploreSessionsQuery.SESSION_ID),cursor.getString(ExploreSessionsQuery.PHOTO_URL),cursor.getString(ExploreSessionsQuery.MAIN_TAG),cursor.getLong(ExploreSessionsQuery.SESSION_START),cursor.getLong(ExploreSessionsQuery.SESSION_END),cursor.getString(ExploreSessionsQuery.LIVESTREAM_ID),cursor.getString(ExploreSessionsQuery.YOUTUBE_URL),cursor.getString(ExploreSessionsQuery.TAGS),cursor.getLong(ExploreSessionsQuery.IN_MY_SCHEDULE) == 1L);
}

Fixed version (ground truth):
private SessionData createSessionData(Cursor cursor){
  return new SessionData(mContext,cursor.getString(ExploreSessionsQuery.TITLE),cursor.getString(ExploreSessionsQuery.ABSTRACT),cursor.getString(ExploreSessionsQuery.SESSION_ID),cursor.getString(ExploreSessionsQuery.PHOTO_URL),cursor.getString(ExploreSessionsQuery.MAIN_TAG),cursor.getLong(ExploreSessionsQuery.SESSION_START),cursor.getLong(ExploreSessionsQuery.SESSION_END),cursor.getString(ExploreSessionsQuery.LIVESTREAM_ID),cursor.getString(ExploreSessionsQuery.YOUTUBE_URL),cursor.getString(ExploreSessionsQuery.TAGS),cursor.getLong(ExploreSessionsQuery.IN_MY_SCHEDULE) == 1L);
}
Program: 19113
Project: 19113
Buggy source:
private void bindCompactSession(CompactSessionViewHolder holder,final SessionData session){
  holder.footer.setText(TimeUtils.formatShortDateTime(mHost,session.getStartDate()));
}

Fixed version (ground truth):
private void bindCompactSession(CompactSessionViewHolder holder,final SessionData session){
  holder.footer.setText(TimeUtils.formatShortDateTime(mHost,session.getStartDate().getTime()));
}
Program: 19114
Project: 19114
Buggy source:
@Override public void onClick(final View v){
  final ViewGroup.LayoutParams lp=v.getLayoutParams();
  if (!(lp instanceof RecyclerView.LayoutParams))   return;
  final int position=((RecyclerView.LayoutParams)lp).getViewAdapterPosition();
  if (position == RecyclerView.NO_POSITION)   return;
  final SessionData sessionData=(SessionData)mItems.get(position);
  final Intent intent=new Intent(mHost,SessionDetailActivity.class);
  intent.setData(ScheduleContract.Sessions.buildSessionUri(sessionData.getSessionId()));
  ActivityCompat.startActivity(mHost,intent,null);
}

Fixed version (ground truth):
@Override public void onClick(final View v){
  final ViewGroup.LayoutParams lp=v.getLayoutParams();
  if (!(lp instanceof RecyclerView.LayoutParams)) {
    return;
  }
  final int position=((RecyclerView.LayoutParams)lp).getViewAdapterPosition();
  if (position == RecyclerView.NO_POSITION) {
    return;
  }
  final SessionData sessionData=(SessionData)mItems.get(position);
  final Intent intent=new Intent(mHost,SessionDetailActivity.class);
  intent.setData(ScheduleContract.Sessions.buildSessionUri(sessionData.getSessionId()));
  ActivityCompat.startActivity(mHost,intent,null);
}
Program: 19115
Project: 19115
Buggy source:
/** 
 * Process the given list of sessions. If we are in detail mode then insert day/time headers.
 */
private List processData(final List<SessionData> sessions){
  final List data=new ArrayList(sessions.size());
  Collections.sort(sessions,new Comparator<SessionData>(){
    @Override public int compare(    final SessionData lhs,    final SessionData rhs){
      return lhs.getStartDate().compareTo(rhs.getStartDate());
    }
  }
);
  if (mCompactMode) {
    data.addAll(sessions);
  }
 else {
    int day=-1, time=-1;
    for (    SessionData session : sessions) {
      if (session.getStartDate().getDate() > day) {
        day=session.getStartDate().getDate();
        data.add(new DayHeader(TimeUtils.formatShortDate(mHost,session.getStartDate())));
        time=-1;
      }
      if (session.getStartDate().getHours() > time) {
        time=session.getStartDate().getHours();
        data.add(new TimeHeader(TimeUtils.formatShortTime(mHost,session.getStartDate())));
      }
      data.add(session);
    }
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Process the given list of sessions. If we are in detail mode then insert day/time headers.
 */
private List processData(final List<SessionData> sessions){
  final List data=new ArrayList(sessions.size());
  Collections.sort(sessions,new Comparator<SessionData>(){
    @Override public int compare(    final SessionData lhs,    final SessionData rhs){
      return lhs.getStartDate().compareTo(rhs.getStartDate());
    }
  }
);
  if (mCompactMode) {
    data.addAll(sessions);
  }
 else {
    int day=-1, time=-1;
    for (    SessionData session : sessions) {
      if (session.getStartDate().get(Calendar.DAY_OF_YEAR) > day) {
        day=session.getStartDate().get(Calendar.DAY_OF_YEAR);
        data.add(new DayHeader(TimeUtils.formatShortDate(mHost,session.getStartDate().getTime())));
        time=-1;
      }
      if (session.getStartDate().get(Calendar.HOUR_OF_DAY) > time) {
        time=session.getStartDate().get(Calendar.HOUR_OF_DAY);
        data.add(new TimeHeader(TimeUtils.formatShortTime(mHost,session.getStartDate().getTime())));
      }
      data.add(session);
    }
  }
  return data;
}
Program: 19116
Project: 19116
Buggy source:
@Override public void onStatusChanged(int which){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
      if (TextUtils.isEmpty(accountName)) {
        onRefreshingStateChanged(false);
        mManualSyncRequest=false;
        return;
      }
      Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
      boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
      boolean syncPending=ContentResolver.isSyncPending(account,ScheduleContract.CONTENT_AUTHORITY);
      if (!syncActive && !syncPending) {
        mManualSyncRequest=false;
      }
      onRefreshingStateChanged(syncActive || mManualSyncRequest);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onStatusChanged(int which){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
      if (TextUtils.isEmpty(accountName)) {
        onRefreshingStateChanged(false);
        return;
      }
      Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
      boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
      onRefreshingStateChanged(syncActive);
    }
  }
);
}
Program: 19117
Project: 19117
Buggy source:
@Override public void run(){
  String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
  if (TextUtils.isEmpty(accountName)) {
    onRefreshingStateChanged(false);
    mManualSyncRequest=false;
    return;
  }
  Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
  boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
  boolean syncPending=ContentResolver.isSyncPending(account,ScheduleContract.CONTENT_AUTHORITY);
  if (!syncActive && !syncPending) {
    mManualSyncRequest=false;
  }
  onRefreshingStateChanged(syncActive || mManualSyncRequest);
}

Fixed version (ground truth):
@Override public void run(){
  String accountName=AccountUtils.getActiveAccountName(BaseActivity.this);
  if (TextUtils.isEmpty(accountName)) {
    onRefreshingStateChanged(false);
    return;
  }
  Account account=new Account(accountName,GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
  boolean syncActive=ContentResolver.isSyncActive(account,ScheduleContract.CONTENT_AUTHORITY);
  onRefreshingStateChanged(syncActive);
}
Program: 19118
Project: 19118
Buggy source:
protected void requestDataRefresh(){
  Account activeAccount=AccountUtils.getActiveAccount(this);
  ContentResolver contentResolver=getContentResolver();
  if (contentResolver.isSyncActive(activeAccount,ScheduleContract.CONTENT_AUTHORITY)) {
    LOGD(TAG,"String_Node_Str");
    return;
  }
  mManualSyncRequest=true;
  LOGD(TAG,"String_Node_Str");
  SyncHelper.requestManualSync(activeAccount);
}

Fixed version (ground truth):
protected void requestDataRefresh(){
  Account activeAccount=AccountUtils.getActiveAccount(this);
  ContentResolver contentResolver=getContentResolver();
  if (contentResolver.isSyncActive(activeAccount,ScheduleContract.CONTENT_AUTHORITY)) {
    LOGD(TAG,"String_Node_Str");
    return;
  }
  LOGD(TAG,"String_Node_Str");
  SyncHelper.requestManualSync(activeAccount);
}
Program: 19119
Project: 19119
Buggy source:
/** 
 * On Lollipop+ perform a circular reveal animation (an expanding circular mask) when showing the search panel.
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void doEnterAnim(){
  View scrim=findViewById(R.id.scrim);
  scrim.animate().alpha(1f).setDuration(500L).setInterpolator(AnimationUtils.loadInterpolator(this,android.R.interpolator.fast_out_slow_in)).start();
  final View searchPanel=findViewById(R.id.search_panel);
  if (searchPanel != null) {
    searchPanel.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
      @Override public boolean onPreDraw(){
        searchPanel.getViewTreeObserver().removeOnPreDrawListener(this);
        int revealRadius=((ViewGroup)searchPanel.getParent()).getHeight();
        Animator show=ViewAnimationUtils.createCircularReveal(searchPanel,searchPanel.getRight(),searchPanel.getTop(),0f,revealRadius);
        show.setDuration(250L);
        show.setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,android.R.interpolator.fast_out_slow_in));
        show.start();
        return false;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * On Lollipop+ perform a circular reveal animation (an expanding circular mask) when showing the search panel.
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void doEnterAnim(){
  View scrim=findViewById(R.id.scrim);
  scrim.animate().alpha(1f).setDuration(500L).setInterpolator(AnimationUtils.loadInterpolator(this,android.R.interpolator.fast_out_slow_in)).start();
  final View searchPanel=findViewById(R.id.search_panel);
  if (searchPanel != null) {
    searchPanel.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
      @Override public boolean onPreDraw(){
        searchPanel.getViewTreeObserver().removeOnPreDrawListener(this);
        final ViewGroup searchPanelParent=(ViewGroup)searchPanel.getParent();
        final int revealRadius=(int)Math.hypot(searchPanelParent.getWidth(),searchPanelParent.getHeight());
        Animator show=ViewAnimationUtils.createCircularReveal(searchPanel,searchPanel.getRight(),searchPanel.getTop(),0f,revealRadius);
        show.setDuration(250L);
        show.setInterpolator(AnimationUtils.loadInterpolator(SearchActivity.this,android.R.interpolator.fast_out_slow_in));
        show.start();
        return false;
      }
    }
);
  }
}