nus-yam/ex-repair huggingface dataset:
Program: 19027
Project: 19027
Buggy source:
public void setStatus(ReservationStatus status){
  this.status=status;
  refreshDrawableState();
  text.setText(status.text);
}

Fixed version (ground truth):
public void setStatus(ReservationStatus status){
  if (this.status == status)   return;
  this.status=status;
  refreshDrawableState();
  text.setText(status.text);
}
Program: 19028
Project: 19028
Buggy source:
/** 
 * Update UI to reflect reservation status known to ContentProvider.
 */
public void updateReservationStatusFromServer(SessionDetailModel sessionDetailModel){
  int reservationStatus=sessionDetailModel.getServerReservationStatus();
switch (reservationStatus) {
case ScheduleContract.MyReservations.RESERVATION_STATUS_RESERVED:
    showAlreadyReserved();
  break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_UNRESERVED:
updateSeatsAvailability(sessionDetailModel);
break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_WAITLISTED:
showWaitlisted();
break;
}
}

Fixed version (ground truth):
/** 
 * Update UI to reflect reservation status known to ContentProvider.
 */
public void updateReservationStatusFromServer(SessionDetailModel sessionDetailModel){
  int reservationStatus=sessionDetailModel.getServerReservationStatus();
switch (reservationStatus) {
case ScheduleContract.MyReservations.RESERVATION_STATUS_RESERVED:
    showAlreadyReserved();
  break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_UNRESERVED:
updateReservationStatusAndSeatAvailability(sessionDetailModel);
break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_WAITLISTED:
showWaitlisted();
break;
}
}
Program: 19029
Project: 19029
Buggy source:
@Override public void displayData(SessionDetailModel data,SessionDetailQueryEnum query){
switch (query) {
case SESSIONS:
    displaySessionData(data);
  displayTrackColor(data);
break;
case FEEDBACK:
updateFeedbackButton(data);
break;
case SPEAKERS:
displaySpeakersData(data);
break;
case TAG_METADATA:
displayTags(data);
displayTrackColor(data);
break;
case RELATED:
displayRelatedSessions(data);
break;
case RESERVATION_STATUS:
updateReservationStatus(data);
break;
case RESERVATION_RESULT:
updateReservationResult(data);
break;
case RESERVATION_PENDING:
updateReservationPending(data);
break;
case RESERVATION_FAILED:
showRequestFailed();
updateReservationStatus(data);
break;
case RESERVATION_SEAT_AVAILABILITY:
updateSeatsAvailability(data);
break;
case AUTH_REGISTRATION:
updateAuthRegistration(data);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void displayData(SessionDetailModel data,SessionDetailQueryEnum query){
switch (query) {
case SESSIONS:
    displaySessionData(data);
  displayTrackColor(data);
break;
case FEEDBACK:
updateFeedbackButton(data);
break;
case SPEAKERS:
displaySpeakersData(data);
break;
case TAG_METADATA:
displayTags(data);
displayTrackColor(data);
break;
case RELATED:
displayRelatedSessions(data);
break;
case RESERVATION_STATUS:
updateReservationStatusAndSeatAvailability(data);
break;
case RESERVATION_RESULT:
updateReservationResult(data);
break;
case RESERVATION_PENDING:
updateReservationPending(data);
break;
case RESERVATION_FAILED:
showRequestFailed();
updateReservationStatusAndSeatAvailability(data);
break;
case RESERVATION_SEAT_AVAILABILITY:
updateReservationStatusAndSeatAvailability(data);
break;
case AUTH_REGISTRATION:
updateAuthRegistration(data);
break;
default :
break;
}
}
Program: 19030
Project: 19030
Buggy source:
/** 
 * Update UI based on reservation request result. Usually this means presenting a dialog and/or updating the reservation button UI.
 */
public void updateReservationResult(SessionDetailModel sessionDetailModel){
  String reservationResult=sessionDetailModel.getReservationResult();
  if (reservationResult != null && isAdded()) {
    LOGD(TAG,"String_Node_Str" + reservationResult);
switch (reservationResult) {
case SessionDetailConstants.RESERVE_DENIED_CUTOFF:
      showReservationDeniedCutoff();
    break;
case SessionDetailConstants.RESERVE_DENIED_CLASH:
  showReservationDeniedClash();
break;
case SessionDetailConstants.RESERVE_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RESERVE_DENIED_SPACE:
showReservationDeniedSpace();
break;
case SessionDetailConstants.RESERVED:
showReservationSuccessful();
break;
case SessionDetailConstants.RETURN_DENIED_CUTOFF:
showReturnDeniedCutoff();
break;
case SessionDetailConstants.RETURN_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RETURNED:
break;
}
updateReservationStatus(sessionDetailModel);
}
}

Fixed version (ground truth):
/** 
 * Update UI based on reservation request result. Usually this means presenting a dialog and/or updating the reservation button UI.
 */
public void updateReservationResult(SessionDetailModel sessionDetailModel){
  String reservationResult=sessionDetailModel.getReservationResult();
  if (reservationResult != null && isAdded()) {
    LOGD(TAG,"String_Node_Str" + reservationResult);
switch (reservationResult) {
case SessionDetailConstants.RESERVE_DENIED_CUTOFF:
      showReservationDeniedCutoff();
    break;
case SessionDetailConstants.RESERVE_DENIED_CLASH:
  showReservationDeniedClash();
break;
case SessionDetailConstants.RESERVE_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RESERVE_DENIED_SPACE:
showReservationDeniedSpace();
break;
case SessionDetailConstants.RESERVED:
showReservationSuccessful();
break;
case SessionDetailConstants.RETURN_DENIED_CUTOFF:
showReturnDeniedCutoff();
break;
case SessionDetailConstants.RETURN_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RETURNED:
break;
}
updateReservationStatusAndSeatAvailability(sessionDetailModel);
}
}
Program: 19031
Project: 19031
Buggy source:
@Override public void requestData(@NonNull SessionDetailQueryEnum query,@NonNull DataQueryCallback<SessionDetailQueryEnum> callback){
switch (query) {
case RESERVATION_PENDING:
case RESERVATION_STATUS:
case RESERVATION_RESULT:
    mDataQueryCallbacks.put(query,callback);
  break;
default :
super.requestData(query,callback);
break;
}
}

Fixed version (ground truth):
@Override public void requestData(@NonNull SessionDetailQueryEnum query,@NonNull DataQueryCallback<SessionDetailQueryEnum> callback){
switch (query) {
case RESERVATION_PENDING:
case RESERVATION_STATUS:
case RESERVATION_RESULT:
case RESERVATION_FAILED:
case RESERVATION_SEAT_AVAILABILITY:
    mDataQueryCallbacks.put(query,callback);
  break;
default :
super.requestData(query,callback);
break;
}
}
Program: 19032
Project: 19032
Buggy source:
/** 
 * Update UI to reflect reservation status known to ContentProvider.
 */
public void updateReservationStatusFromServer(SessionDetailModel sessionDetailModel){
  int reservationStatus=sessionDetailModel.getServerReservationStatus();
switch (reservationStatus) {
case ScheduleContract.MyReservations.RESERVATION_STATUS_RESERVED:
    showAlreadyReserved();
  break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_UNRESERVED:
updateSeatsAvailability(sessionDetailModel);
break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_WAITLISTED:
showWaitlisted();
break;
}
}

Fixed version (ground truth):
/** 
 * Update UI to reflect reservation status known to ContentProvider.
 */
public void updateReservationStatusFromServer(SessionDetailModel sessionDetailModel){
  int reservationStatus=sessionDetailModel.getServerReservationStatus();
switch (reservationStatus) {
case ScheduleContract.MyReservations.RESERVATION_STATUS_RESERVED:
    showAlreadyReserved();
  break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_UNRESERVED:
updateReservationStatusAndSeatAvailability(sessionDetailModel);
break;
case ScheduleContract.MyReservations.RESERVATION_STATUS_WAITLISTED:
showWaitlisted();
break;
}
}
Program: 19033
Project: 19033
Buggy source:
@Override public void displayData(SessionDetailModel data,SessionDetailQueryEnum query){
switch (query) {
case SESSIONS:
    displaySessionData(data);
  displayTrackColor(data);
break;
case FEEDBACK:
updateFeedbackButton(data);
break;
case SPEAKERS:
displaySpeakersData(data);
break;
case TAG_METADATA:
displayTags(data);
displayTrackColor(data);
break;
case RELATED:
displayRelatedSessions(data);
break;
case RESERVATION_STATUS:
updateReservationStatus(data);
break;
case RESERVATION_RESULT:
updateReservationResult(data);
break;
case RESERVATION_PENDING:
updateReservationPending(data);
break;
case RESERVATION_FAILED:
showRequestFailed();
updateReservationStatus(data);
break;
case RESERVATION_SEAT_AVAILABILITY:
updateSeatsAvailability(data);
break;
case AUTH_REGISTRATION:
updateAuthRegistration(data);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void displayData(SessionDetailModel data,SessionDetailQueryEnum query){
switch (query) {
case SESSIONS:
    displaySessionData(data);
  displayTrackColor(data);
break;
case FEEDBACK:
updateFeedbackButton(data);
break;
case SPEAKERS:
displaySpeakersData(data);
break;
case TAG_METADATA:
displayTags(data);
displayTrackColor(data);
break;
case RELATED:
displayRelatedSessions(data);
break;
case RESERVATION_STATUS:
updateReservationStatusAndSeatAvailability(data);
break;
case RESERVATION_RESULT:
updateReservationResult(data);
break;
case RESERVATION_PENDING:
updateReservationPending(data);
break;
case RESERVATION_FAILED:
showRequestFailed();
updateReservationStatusAndSeatAvailability(data);
break;
case RESERVATION_SEAT_AVAILABILITY:
updateReservationStatusAndSeatAvailability(data);
break;
case AUTH_REGISTRATION:
updateAuthRegistration(data);
break;
default :
break;
}
}
Program: 19034
Project: 19034
Buggy source:
/** 
 * Update UI based on reservation request result. Usually this means presenting a dialog and/or updating the reservation button UI.
 */
public void updateReservationResult(SessionDetailModel sessionDetailModel){
  String reservationResult=sessionDetailModel.getReservationResult();
  if (reservationResult != null && isAdded()) {
    LOGD(TAG,"String_Node_Str" + reservationResult);
switch (reservationResult) {
case SessionDetailConstants.RESERVE_DENIED_CUTOFF:
      showReservationDeniedCutoff();
    break;
case SessionDetailConstants.RESERVE_DENIED_CLASH:
  showReservationDeniedClash();
break;
case SessionDetailConstants.RESERVE_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RESERVE_DENIED_SPACE:
showReservationDeniedSpace();
break;
case SessionDetailConstants.RESERVED:
showReservationSuccessful();
break;
case SessionDetailConstants.RETURN_DENIED_CUTOFF:
showReturnDeniedCutoff();
break;
case SessionDetailConstants.RETURN_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RETURNED:
break;
}
updateReservationStatus(sessionDetailModel);
}
}

Fixed version (ground truth):
/** 
 * Update UI based on reservation request result. Usually this means presenting a dialog and/or updating the reservation button UI.
 */
public void updateReservationResult(SessionDetailModel sessionDetailModel){
  String reservationResult=sessionDetailModel.getReservationResult();
  if (reservationResult != null && isAdded()) {
    LOGD(TAG,"String_Node_Str" + reservationResult);
switch (reservationResult) {
case SessionDetailConstants.RESERVE_DENIED_CUTOFF:
      showReservationDeniedCutoff();
    break;
case SessionDetailConstants.RESERVE_DENIED_CLASH:
  showReservationDeniedClash();
break;
case SessionDetailConstants.RESERVE_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RESERVE_DENIED_SPACE:
showReservationDeniedSpace();
break;
case SessionDetailConstants.RESERVED:
showReservationSuccessful();
break;
case SessionDetailConstants.RETURN_DENIED_CUTOFF:
showReturnDeniedCutoff();
break;
case SessionDetailConstants.RETURN_DENIED_FAILED:
showRequestFailed();
break;
case SessionDetailConstants.RETURNED:
break;
}
updateReservationStatusAndSeatAvailability(sessionDetailModel);
}
}
Program: 19035
Project: 19035
Buggy source:
@Override public void requestData(@NonNull SessionDetailQueryEnum query,@NonNull DataQueryCallback<SessionDetailQueryEnum> callback){
switch (query) {
case RESERVATION_PENDING:
case RESERVATION_STATUS:
case RESERVATION_RESULT:
    mDataQueryCallbacks.put(query,callback);
  break;
default :
super.requestData(query,callback);
break;
}
}

Fixed version (ground truth):
@Override public void requestData(@NonNull SessionDetailQueryEnum query,@NonNull DataQueryCallback<SessionDetailQueryEnum> callback){
switch (query) {
case RESERVATION_PENDING:
case RESERVATION_STATUS:
case RESERVATION_RESULT:
case RESERVATION_FAILED:
case RESERVATION_SEAT_AVAILABILITY:
    mDataQueryCallbacks.put(query,callback);
  break;
default :
super.requestData(query,callback);
break;
}
}
Program: 19036
Project: 19036
Buggy source:
@Override public void onClick(final View view){
  WelcomeUtils.markUserRefusedSignInDuringOnboarding(mActivity,true);
  doNext();
}

Fixed version (ground truth):
@Override public void onClick(final View view){
  WelcomeUtils.markUserRefusedOnboardingSignIn(mActivity);
  doNext();
}
Program: 19037
Project: 19037
Buggy source:
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      Intent signInIntent=Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
      startActivityForResult(signInIntent,AccountUtils.RC_SIGN_IN);
    }
  }
;
}

Fixed version (ground truth):
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserAttemptedOnboardingSignIn(mActivity);
      Intent signInIntent=Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
      startActivityForResult(signInIntent,AccountUtils.RC_SIGN_IN);
    }
  }
;
}
Program: 19038
Project: 19038
Buggy source:
@Override protected View.OnClickListener getSecondaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserRefusedSignInDuringOnboarding(mActivity,true);
      doNext();
    }
  }
;
}

Fixed version (ground truth):
@Override protected View.OnClickListener getSecondaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserRefusedOnboardingSignIn(mActivity);
      doNext();
    }
  }
;
}
Program: 19039
Project: 19039
Buggy source:
@Override public boolean shouldDisplay(final Context context){
  return AccountUtils.getActiveAccount(context) == null && !WelcomeUtils.hasUserRefusedSignInDuringOnboarding(context);
}

Fixed version (ground truth):
@Override public boolean shouldDisplay(final Context context){
  return !(WelcomeUtils.hasUserAttemptedOnboardingSignIn(context) || WelcomeUtils.hasUserRefusedOnboardingSignIn(context));
}
Program: 19040
Project: 19040
Buggy source:
@Override public void onClick(final View view){
  WelcomeUtils.markUserRefusedSignInDuringOnboarding(mActivity,true);
  doNext();
}

Fixed version (ground truth):
@Override public void onClick(final View view){
  WelcomeUtils.markUserRefusedOnboardingSignIn(mActivity);
  doNext();
}
Program: 19041
Project: 19041
Buggy source:
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      Intent signInIntent=Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
      startActivityForResult(signInIntent,AccountUtils.RC_SIGN_IN);
    }
  }
;
}

Fixed version (ground truth):
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserAttemptedOnboardingSignIn(mActivity);
      Intent signInIntent=Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
      startActivityForResult(signInIntent,AccountUtils.RC_SIGN_IN);
    }
  }
;
}
Program: 19042
Project: 19042
Buggy source:
@Override protected View.OnClickListener getSecondaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserRefusedSignInDuringOnboarding(mActivity,true);
      doNext();
    }
  }
;
}

Fixed version (ground truth):
@Override protected View.OnClickListener getSecondaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserRefusedOnboardingSignIn(mActivity);
      doNext();
    }
  }
;
}
Program: 19043
Project: 19043
Buggy source:
@Override public boolean shouldDisplay(final Context context){
  return AccountUtils.getActiveAccount(context) == null && !WelcomeUtils.hasUserRefusedSignInDuringOnboarding(context);
}

Fixed version (ground truth):
@Override public boolean shouldDisplay(final Context context){
  return !(WelcomeUtils.hasUserAttemptedOnboardingSignIn(context) || WelcomeUtils.hasUserRefusedOnboardingSignIn(context));
}
Program: 19044
Project: 19044
Buggy source:
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserAttemptedOnboardingSignIn(mActivity);
      ((WelcomeActivity)mActivity).signIn();
      mActivity.finish();
    }
  }
;
}

Fixed version (ground truth):
@Override protected View.OnClickListener getPrimaryButtonListener(){
  return new View.OnClickListener(){
    @Override public void onClick(    final View view){
      WelcomeUtils.markUserAttemptedOnboardingSignIn(mActivity);
      ((WelcomeActivity)mActivity).signIn();
    }
  }
;
}
Program: 19045
Project: 19045
Buggy source:
/** 
 * Proceed to the next activity.
 */
public void doNext(){
  LOGD(TAG,"String_Node_Str");
  Intent intent=new Intent(this,MyIOActivity.class);
  startActivity(intent);
}

Fixed version (ground truth):
/** 
 * Proceed to the next activity.
 */
public void doNext(){
  LOGD(TAG,"String_Node_Str");
  Intent intent=new Intent(this,MyIOActivity.class);
  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  startActivity(intent);
  finish();
}
Program: 19046
Project: 19046
Buggy source:
@Override public void displayUserActionResult(final ExploreIOModel model,final ExploreIOUserActionEnum userAction,final boolean success){
}

Fixed version (ground truth):
@Override public void displayUserActionResult(final ExploreIOModel model,final ExploreIOUserActionEnum userAction,final boolean success){
switch (userAction) {
case RELOAD:
    displayData(model,ExploreIOQueryEnum.SESSIONS);
  break;
}
}
Program: 19047
Project: 19047
Buggy source:
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (SettingsUtils.PREF_DECLINED_WIFI_SETUP.equals(key)) {
    fireReloadEvent();
  }
}

Fixed version (ground truth):
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (SettingsUtils.PREF_DECLINED_WIFI_SETUP.equals(key)) {
    fireReloadEvent();
  }
 else   if (AccountUtils.PREF_ACTIVE_ACCOUNT.equals(key)) {
    fireReloadEvent();
  }
}
Program: 19048
Project: 19048
Buggy source:
@Override public void displayUserActionResult(final VideoLibraryModel model,final VideoLibraryUserActionEnum userAction,final boolean success){
}

Fixed version (ground truth):
@Override public void displayUserActionResult(final VideoLibraryModel model,final VideoLibraryUserActionEnum userAction,final boolean success){
switch (userAction) {
case VIDEO_PLAYED:
case RELOAD_USER_VIDEOS:
    displayData(model,VideoLibraryQueryEnum.MY_VIEWED_VIDEOS);
  break;
}
}
Program: 19049
Project: 19049
Buggy source:
private void initPresenter(){
  VideoLibraryModel model=ModelProvider.provideVideoLibraryModel(getDataUri(VideoLibraryQueryEnum.VIDEOS),getDataUri(VideoLibraryQueryEnum.MY_VIEWED_VIDEOS),getDataUri(VideoLibraryQueryEnum.FILTERS),getActivity(),getLoaderManager());
  PresenterImpl presenter=new PresenterImpl(model,this,VideoLibraryUserActionEnum.values(),VideoLibraryQueryEnum.values());
  presenter.loadInitialQueries();
  addListener(presenter);
}

Fixed version (ground truth):
private void initPresenter(){
  VideoLibraryModel model=ModelProvider.provideVideoLibraryModel(getDataUri(VideoLibraryQueryEnum.VIDEOS),getDataUri(VideoLibraryQueryEnum.MY_VIEWED_VIDEOS),getDataUri(VideoLibraryQueryEnum.FILTERS),getActivity(),getLoaderManager());
  PresenterImpl presenter=new PresenterImpl(model,this,VideoLibraryUserActionEnum.values(),VideoLibraryQueryEnum.values());
  presenter.loadInitialQueries();
}
Program: 19050
Project: 19050
Buggy source:
@Override public boolean readDataFromCursor(final Cursor cursor,final VideoLibraryQueryEnum query){
  LOGD(TAG,"String_Node_Str");
switch (query) {
case VIDEOS:
    LOGD(TAG,"String_Node_Str");
  if (cursor.moveToFirst()) {
    processVideos(cursor);
    markVideosAsViewed();
  }
return true;
case MY_VIEWED_VIDEOS:
LOGD(TAG,"String_Node_Str");
if (cursor.moveToFirst()) {
Set<String> viewedVideoIds=new HashSet<>();
do {
viewedVideoIds.add(cursor.getString(cursor.getColumnIndex(ScheduleContract.MyViewedVideos.VIDEO_ID)));
}
 while (cursor.moveToNext());
if (!mViewedVideosIds.containsAll(viewedVideoIds)) {
mViewedVideosIds=viewedVideoIds;
markVideosAsViewed();
return true;
}
}
return false;
case FILTERS:
LOGD(TAG,"String_Node_Str");
mYears=new ArrayList<>();
mTopics=new ArrayList<>();
if (cursor != null && cursor.moveToFirst()) {
do {
int year=cursor.getInt(cursor.getColumnIndex(ScheduleContract.Videos.VIDEO_YEAR));
String topic=cursor.getString(cursor.getColumnIndex(ScheduleContract.Videos.VIDEO_TOPIC));
if (!mYears.contains(year)) {
mYears.add(year);
}
if (!TextUtils.isEmpty(topic) && !mTopics.contains(topic)) {
mTopics.add(topic);
}
}
 while (cursor.moveToNext());
}
Collections.sort(mYears,new Comparator<Integer>(){
@Override public int compare(Integer a,Integer b){
return b.compareTo(a);
}
}
);
Collections.sort(mTopics);
return true;
case TAGS:
mTagMetadata=new TagMetadata(cursor);
addImageUrlToVideoTracksIfAvailable();
return true;
default :
return false;
}
}

Fixed version (ground truth):
@Override public boolean readDataFromCursor(final Cursor cursor,final VideoLibraryQueryEnum query){
  LOGD(TAG,"String_Node_Str");
switch (query) {
case VIDEOS:
    LOGD(TAG,"String_Node_Str");
  if (cursor.moveToFirst()) {
    processVideos(cursor);
    markVideosAsViewed();
  }
return true;
case MY_VIEWED_VIDEOS:
LOGD(TAG,"String_Node_Str");
mViewedVideosIds.clear();
if (cursor.moveToFirst()) {
do {
mViewedVideosIds.add(cursor.getString(cursor.getColumnIndex(ScheduleContract.MyViewedVideos.VIDEO_ID)));
}
 while (cursor.moveToNext());
markVideosAsViewed();
return true;
}
return true;
case FILTERS:
LOGD(TAG,"String_Node_Str");
mYears=new ArrayList<>();
mTopics=new ArrayList<>();
if (cursor != null && cursor.moveToFirst()) {
do {
int year=cursor.getInt(cursor.getColumnIndex(ScheduleContract.Videos.VIDEO_YEAR));
String topic=cursor.getString(cursor.getColumnIndex(ScheduleContract.Videos.VIDEO_TOPIC));
if (!mYears.contains(year)) {
mYears.add(year);
}
if (!TextUtils.isEmpty(topic) && !mTopics.contains(topic)) {
mTopics.add(topic);
}
}
 while (cursor.moveToNext());
}
Collections.sort(mYears,new Comparator<Integer>(){
@Override public int compare(Integer a,Integer b){
return b.compareTo(a);
}
}
);
Collections.sort(mTopics);
return true;
case TAGS:
mTagMetadata=new TagMetadata(cursor);
addImageUrlToVideoTracksIfAvailable();
return true;
default :
return false;
}
}
Program: 19051
Project: 19051
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 Video video=(Video)mItems.get(position);
  final String videoId=video.getId();
  final String youtubeLink=TextUtils.isEmpty(videoId) ? "String_Node_Str" : videoId.contains("String_Node_Str") ? videoId : String.format(Locale.US,Config.VIDEO_LIBRARY_URL_FMT,videoId);
  if (!TextUtils.isEmpty(youtubeLink)) {
    AnalyticsHelper.sendEvent(VIDEO_LIBRARY_ANALYTICS_CATEGORY,"String_Node_Str",youtubeLink);
    Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse(youtubeLink));
    UIUtils.preferPackageForIntent(mHost,i,UIUtils.YOUTUBE_PACKAGE_NAME);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    mHost.startActivity(i);
    fireVideoPlayedEvent(video);
  }
}

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 Video video=(Video)mItems.get(position);
  final String videoId=video.getId();
  final String youtubeLink=TextUtils.isEmpty(videoId) ? "String_Node_Str" : videoId.contains("String_Node_Str") ? videoId : String.format(Locale.US,Config.VIDEO_LIBRARY_URL_FMT,videoId);
  if (!TextUtils.isEmpty(youtubeLink)) {
    AnalyticsHelper.sendEvent(VIDEO_LIBRARY_ANALYTICS_CATEGORY,"String_Node_Str",youtubeLink);
    Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse(youtubeLink));
    UIUtils.preferPackageForIntent(mHost,i,UIUtils.YOUTUBE_PACKAGE_NAME);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    mHost.startActivity(i);
    fireVideoPlayedEvent(video);
  }
}
Program: 19052
Project: 19052
Buggy source:
@Override public void update(@NonNull final List<Video> updatedData){
  final List newItems=processData(updatedData);
  if (newItems.size() != mItems.size()) {
    mItems=newItems;
    notifyDataSetChanged();
    return;
  }
  for (int i=0; i < newItems.size(); i++) {
    final Object oldItem=mItems.get(i);
    final Object newItem=newItems.get(i);
    if (!oldItem.equals(newItem)) {
      mItems.set(i,newItem);
      notifyItemChanged(i);
    }
  }
}

Fixed version (ground truth):
@Override public void update(@NonNull final List<Video> updatedData){
  final List newItems=processData(updatedData);
  if (newItems.size() != mItems.size()) {
    mItems=newItems;
    notifyDataSetChanged();
    return;
  }
  for (int i=0; i < newItems.size(); i++) {
    final Object oldItem=mItems.get(i);
    final Object newItem=newItems.get(i);
    if (!oldItem.equals(newItem) || (newItem instanceof Video && ((Video)newItem).dataUpdated())) {
      mItems.set(i,newItem);
      notifyItemChanged(i);
    }
  }
}
Program: 19053
Project: 19053
Buggy source:
/** 
 * Process the given   {@code vidoe} to create the list of items to be displayed bythe  {@link RecyclerView}. In detail mode, this means inserting date header objects to separate videos by year.
 */
private List processData(final List<Video> videos){
  List data=new ArrayList(videos.size());
  if (mCompactMode) {
    data.addAll(videos);
  }
 else {
    int currentYear=Integer.MAX_VALUE;
    for (    final Video video : videos) {
      if (video.getYear() < currentYear) {
        currentYear=video.getYear();
        data.add(new YearHeader(String.valueOf(currentYear)));
      }
      data.add(video);
    }
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Process the given   {@code vidoe} to create the list of items to be displayed by the {@link RecyclerView}. In detail mode, this means inserting date header objects to separate videos by year.
 */
private List processData(final List<Video> videos){
  List data=new ArrayList(videos.size());
  if (mCompactMode) {
    data.addAll(videos);
  }
 else {
    int currentYear=Integer.MAX_VALUE;
    for (    final Video video : videos) {
      if (video.getYear() < currentYear) {
        currentYear=video.getYear();
        data.add(new YearHeader(String.valueOf(currentYear)));
      }
      data.add(video);
    }
  }
  return data;
}
Program: 19054
Project: 19054
Buggy source:
public void setAlreadyPlayed(boolean alreadyPlayed){
  mAlreadyPlayed=alreadyPlayed;
}

Fixed version (ground truth):
public void setAlreadyPlayed(boolean alreadyPlayed){
  if (mAlreadyPlayed != alreadyPlayed) {
    mDataUpdated=true;
  }
  mAlreadyPlayed=alreadyPlayed;
}
Program: 19055
Project: 19055
Buggy source:
@Override public void displayUserActionResult(final ExploreIOModel model,final ExploreIOUserActionEnum userAction,final boolean success){
}

Fixed version (ground truth):
@Override public void displayUserActionResult(final ExploreIOModel model,final ExploreIOUserActionEnum userAction,final boolean success){
switch (userAction) {
case RELOAD:
    displayData(model,ExploreIOQueryEnum.SESSIONS);
  break;
}
}
Program: 19056
Project: 19056
Buggy source:
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (SettingsUtils.PREF_DECLINED_WIFI_SETUP.equals(key)) {
    fireReloadEvent();
  }
}

Fixed version (ground truth):
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  if (SettingsUtils.PREF_DECLINED_WIFI_SETUP.equals(key)) {
    fireReloadEvent();
  }
 else   if (AccountUtils.PREF_ACTIVE_ACCOUNT.equals(key)) {
    fireReloadEvent();
  }
}
Program: 19059
Project: 19059
Buggy source:
@Override public void onRequestPermissionsResult(final int requestCode,@NonNull final String[] permissions,@NonNull final int[] grantResults){
  LOGW(TAG,"String_Node_Str" + grantResults.length + "String_Node_Str"+ permissions.length);
  if (grantResults.length == APP_REQUIRED_PERMISSIONS.length && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
    Snackbar snackbar;
    if ((snackbar=mSnackbar.get()) != null && snackbar.isShown()) {
      snackbar.dismiss();
    }
    reloadAccounts();
    refreshAccountListUI();
  }
 else {
    LOGI(TAG,"String_Node_Str");
    mSnackbar=new WeakReference<>(PermissionsUtils.displayConditionalPermissionDenialSnackbar(getActivity(),R.string.welcome_permissions_rationale,APP_REQUIRED_PERMISSIONS,REQUEST_PERMISSION_REQUEST_CODE));
  }
}

Fixed version (ground truth):
@Override public void onRequestPermissionsResult(final int requestCode,@NonNull final String[] permissions,@NonNull final int[] grantResults){
  LOGW(TAG,"String_Node_Str" + grantResults.length + "String_Node_Str"+ permissions.length);
  if (grantResults.length == APP_REQUIRED_PERMISSIONS.length && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
    clearSnackbar();
    reloadAccounts();
    refreshAccountListUI();
  }
 else {
    LOGI(TAG,"String_Node_Str");
    mSnackbar=new WeakReference<>(PermissionsUtils.displayConditionalPermissionDenialSnackbar(getActivity(),R.string.welcome_permissions_rationale,APP_REQUIRED_PERMISSIONS,REQUEST_PERMISSION_REQUEST_CODE));
  }
}
Program: 19060
Project: 19060
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (!displayPermissionRequest(getActivity(),false)) {
    reloadAccounts();
    refreshAccountListUI();
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  clearSnackbar();
  if (!displayPermissionRequest(getActivity(),false)) {
    reloadAccounts();
    refreshAccountListUI();
  }
}
Program: 19062
Project: 19062
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_welcome);
  mContentFragment=getCurrentFragment(this);
  if (mContentFragment == null) {
    finish();
  }
  FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
  fragmentTransaction.add(R.id.welcome_content,(Fragment)mContentFragment);
  fragmentTransaction.commit();
  final ImageView iv=(ImageView)findViewById(R.id.logo);
  final AnimatedVectorDrawableCompat logo=AnimatedVectorDrawableCompat.create(this,R.drawable.avd_hash_io_16);
  if (iv != null && logo != null) {
    iv.setImageDrawable(logo);
    if (UIUtils.animationEnabled(getContentResolver())) {
      logo.start();
    }
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_welcome);
  mContentFragment=getCurrentFragment(this);
  if (mContentFragment == null) {
    finish();
  }
 else {
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.welcome_content,(Fragment)mContentFragment);
    fragmentTransaction.commit();
    final ImageView iv=(ImageView)findViewById(R.id.logo);
    final AnimatedVectorDrawableCompat logo=AnimatedVectorDrawableCompat.create(this,R.drawable.avd_hash_io_16);
    if (iv != null && logo != null) {
      iv.setImageDrawable(logo);
      if (UIUtils.animationEnabled(getContentResolver())) {
        logo.start();
      }
    }
  }
}
Program: 19064
Project: 19064
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_welcome);
  mContentFragment=getCurrentFragment(this);
  if (mContentFragment == null) {
    finish();
  }
  FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
  fragmentTransaction.add(R.id.welcome_content,(Fragment)mContentFragment);
  fragmentTransaction.commit();
  final ImageView iv=(ImageView)findViewById(R.id.logo);
  final AnimatedVectorDrawableCompat logo=AnimatedVectorDrawableCompat.create(this,R.drawable.avd_hash_io_16);
  if (iv != null && logo != null) {
    iv.setImageDrawable(logo);
    if (UIUtils.animationEnabled(getContentResolver())) {
      logo.start();
    }
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_welcome);
  mContentFragment=getCurrentFragment(this);
  if (mContentFragment == null) {
    finish();
  }
 else {
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.welcome_content,(Fragment)mContentFragment);
    fragmentTransaction.commit();
    final ImageView iv=(ImageView)findViewById(R.id.logo);
    final AnimatedVectorDrawableCompat logo=AnimatedVectorDrawableCompat.create(this,R.drawable.avd_hash_io_16);
    if (iv != null && logo != null) {
      iv.setImageDrawable(logo);
      if (UIUtils.animationEnabled(getContentResolver())) {
        logo.start();
      }
    }
  }
}
Program: 19065
Project: 19065
Buggy source:
@Override public void onRequestPermissionsResult(final int requestCode,@NonNull final String[] permissions,@NonNull final int[] grantResults){
  LOGW(TAG,"String_Node_Str" + grantResults.length + "String_Node_Str"+ permissions.length);
  if (grantResults.length == APP_REQUIRED_PERMISSIONS.length && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
    Snackbar snackbar;
    if ((snackbar=mSnackbar.get()) != null && snackbar.isShown()) {
      snackbar.dismiss();
    }
    reloadAccounts();
    refreshAccountListUI();
  }
 else {
    LOGI(TAG,"String_Node_Str");
    mSnackbar=new WeakReference<>(PermissionsUtils.displayConditionalPermissionDenialSnackbar(getActivity(),R.string.welcome_permissions_rationale,APP_REQUIRED_PERMISSIONS,REQUEST_PERMISSION_REQUEST_CODE));
  }
}

Fixed version (ground truth):
@Override public void onRequestPermissionsResult(final int requestCode,@NonNull final String[] permissions,@NonNull final int[] grantResults){
  LOGW(TAG,"String_Node_Str" + grantResults.length + "String_Node_Str"+ permissions.length);
  if (grantResults.length == APP_REQUIRED_PERMISSIONS.length && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
    clearSnackbar();
    reloadAccounts();
    refreshAccountListUI();
  }
 else {
    LOGI(TAG,"String_Node_Str");
    mSnackbar=new WeakReference<>(PermissionsUtils.displayConditionalPermissionDenialSnackbar(getActivity(),R.string.welcome_permissions_rationale,APP_REQUIRED_PERMISSIONS,REQUEST_PERMISSION_REQUEST_CODE));
  }
}
Program: 19066
Project: 19066
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (!displayPermissionRequest(getActivity(),false)) {
    reloadAccounts();
    refreshAccountListUI();
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  clearSnackbar();
  if (!displayPermissionRequest(getActivity(),false)) {
    reloadAccounts();
    refreshAccountListUI();
  }
}
Program: 19069
Project: 19069
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + mTagsById.size() + "String_Node_Str"+ mTagsInCategory.size()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + mId + "String_Node_Str"+ mName;
}
Program: 19070
Project: 19070
Buggy source:
/** 
 * Return whether this is a LiveStreamed session and whether it is happening right now.
 */
public boolean isLiveStreamNow(Context context){
  if (!isLiveStreamAvailable()) {
    return false;
  }
  if (mStartDate == null || mEndDate == null) {
    return false;
  }
  Calendar now=java.util.Calendar.getInstance();
  now.setTimeInMillis(TimeUtils.getCurrentTime(context));
  return mStartDate.before(now.getTime()) && mEndDate.after(now.getTime());
}

Fixed version (ground truth):
/** 
 * Return whether this is a LiveStreamed session and whether it is happening right now.
 */
public boolean isLiveStreamNow(Context context){
  if (!isLiveStreamAvailable()) {
    return false;
  }
  if (mStartDate == null || mEndDate == null) {
    return false;
  }
  Calendar now=java.util.Calendar.getInstance();
  now.setTimeInMillis(TimeUtils.getCurrentTime(context));
  return mStartDate.before(now) && mEndDate.after(now);
}
Program: 19074
Project: 19074
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + mTagsById.size() + "String_Node_Str"+ mTagsInCategory.size()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + mId + "String_Node_Str"+ mName;
}
Program: 19076
Project: 19076
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: 19077
Project: 19077
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: 19078
Project: 19078
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: 19079
Project: 19079
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: 19080
Project: 19080
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: 19081
Project: 19081
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());
}