nus-yam/ex-repair huggingface dataset:
Program: 114047
Project: 114047
Buggy source:
@Override protected void onStart(){
  activityHelper.onStart();
  super.onStart();
}

Fixed version (ground truth):
@Override protected void onStart(){
  activityHelper.onStart();
  if (!isConnectionEnabled()) {
    Toast.makeText(this,getString(R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
  super.onStart();
}
Program: 114048
Project: 114048
Buggy source:
@Override protected void onResume(){
  super.onResume();
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
  if (!isConnectionEnabled()) {
    Toast.makeText(this,getString(R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
}
Program: 114049
Project: 114049
Buggy source:
protected void startLoadDialogMessages(){
  if (dialog == null) {
    return;
  }
  lastMessagesCountInDB=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialogId).getCount();
  showActionBarProgress();
  MessageCache lastReadMessage=ChatDatabaseManager.getLastSyncMessage(this,dialog);
  if (lastReadMessage == null) {
    startLoadDialogMessages(dialog,ConstsCore.ZERO_LONG_VALUE);
    updateMessagesReason=UpdateMessagesReason.DEFAULT;
  }
 else   if (UpdateMessagesReason.DEFAULT == updateMessagesReason) {
    startNewMessagesLoadDialogMessages(dialog,lastReadMessage.getTime(),lastReadMessage.getId());
  }
 else   if (UpdateMessagesReason.ON_USER_REQUEST == updateMessagesReason) {
    startLoadDialogMessages(dialog,lastReadMessage.getTime());
  }
}

Fixed version (ground truth):
protected void startLoadDialogMessages(){
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + String.valueOf(updateMessagesReason));
  if (dialog == null) {
    return;
  }
  lastMessagesCountInDB=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialogId).getCount();
  showActionBarProgress();
  MessageCache lastReadMessage=ChatDatabaseManager.getLastSyncMessage(this,dialog);
  Log.d("String_Node_Str","String_Node_Str" + lastReadMessage);
  if (lastReadMessage == null) {
    Log.d("String_Node_Str","String_Node_Str");
    startLoadDialogMessages(dialog,ConstsCore.ZERO_LONG_VALUE);
    updateMessagesReason=UpdateMessagesReason.DEFAULT;
  }
 else   if (UpdateMessagesReason.DEFAULT == updateMessagesReason) {
    Log.d("String_Node_Str","String_Node_Str");
    startNewMessagesLoadDialogMessages(dialog,lastReadMessage.getTime(),lastReadMessage.getId());
  }
 else   if (UpdateMessagesReason.ON_USER_REQUEST == updateMessagesReason) {
    Log.d("String_Node_Str","String_Node_Str");
    startLoadDialogMessages(dialog,lastReadMessage.getTime());
  }
}
Program: 114050
Project: 114050
Buggy source:
@Override protected void onStart(){
  super.onStart();
  updateMessagesReason=UpdateMessagesReason.DEFAULT;
  if (TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    String messageBody=ChatDatabaseManager.getNotSendMessageBodyByDialogId(getApplicationContext(),dialogId);
    if (messageBody != null) {
      messageEditText.setText(messageBody);
    }
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  Log.d("String_Node_Str","String_Node_Str");
  updateMessagesReason=UpdateMessagesReason.DEFAULT;
  if (TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    String messageBody=ChatDatabaseManager.getNotSendMessageBodyByDialogId(getApplicationContext(),dialogId);
    if (messageBody != null) {
      messageEditText.setText(messageBody);
    }
  }
}
Program: 114051
Project: 114051
Buggy source:
@Override protected void onStop(){
  if (!TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    ChatDatabaseManager.saveNotSendMessage(getApplicationContext(),messageEditText.getText().toString(),dialogId,null);
  }
 else {
    ChatDatabaseManager.deleteNotSentMessagesByDialogId(getApplicationContext(),dialogId);
  }
  super.onStop();
}

Fixed version (ground truth):
@Override protected void onStop(){
  isNeedShowTostAboutDisconnected=false;
  if (!TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    ChatDatabaseManager.saveNotSendMessage(getApplicationContext(),messageEditText.getText().toString(),dialogId,null);
  }
 else {
    ChatDatabaseManager.deleteNotSentMessagesByDialogId(getApplicationContext(),dialogId);
  }
  super.onStop();
}
Program: 114052
Project: 114052
Buggy source:
@Override protected void onResume(){
  super.onResume();
  startLoadDialogMessages();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  isNeedShowTostAboutDisconnected=true;
  Log.d("String_Node_Str","String_Node_Str");
  startLoadDialogMessages();
}
Program: 114053
Project: 114053
Buggy source:
@Override protected void onPause(){
  super.onPause();
  onUpdateChatDialog();
  hideSmileLayout();
  if (QBDialogType.PRIVATE.equals(dialog.getType())) {
    if (isTypingNow) {
      isTypingNow=false;
      sendTypingStatus();
    }
  }
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  Log.d("String_Node_Str","String_Node_Str");
  onUpdateChatDialog();
  hideSmileLayout();
  if (QBDialogType.PRIVATE.equals(dialog.getType())) {
    if (isTypingNow) {
      isTypingNow=false;
      sendTypingStatus();
    }
  }
}
Program: 114054
Project: 114054
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    messagesAdapter.swapCursor(messagesCursor);
    int currentMessageCountInBase=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialogId).getCount();
    if (currentMessageCountInBase > lastMessagesCountInDB) {
      totalEntries=currentMessageCountInBase - lastMessagesCountInDB;
      lastMessagesCountInDB=currentMessageCountInBase;
    }
    if (totalEntries > 0) {
      if (UpdateMessagesReason.ON_USER_REQUEST == updateMessagesReason) {
        int loadMessages=ConstsCore.DIALOG_MESSAGES_PER_PAGE < totalEntries ? ConstsCore.DIALOG_MESSAGES_PER_PAGE : totalEntries;
        messagesListView.setSelection(loadMessages - 1);
        resetTotalEntries();
      }
 else       if (UpdateMessagesReason.DEFAULT == updateMessagesReason) {
        scrollListView();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  Log.d("String_Node_Str","String_Node_Str");
  if (messagesAdapter == null) {
    Log.d("String_Node_Str","String_Node_Str");
    initListView(messagesCursor);
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
    Log.d("String_Node_Str","String_Node_Str" + updateMessagesReason.name());
    messagesAdapter.swapCursor(messagesCursor);
    int currentMessageCountInBase=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialogId).getCount();
    if (currentMessageCountInBase > lastMessagesCountInDB) {
      totalEntries=currentMessageCountInBase - lastMessagesCountInDB;
      lastMessagesCountInDB=currentMessageCountInBase;
    }
    if (totalEntries > 0) {
      if (UpdateMessagesReason.ON_USER_REQUEST == updateMessagesReason) {
        int loadMessages=ConstsCore.DIALOG_MESSAGES_PER_PAGE < totalEntries ? ConstsCore.DIALOG_MESSAGES_PER_PAGE : totalEntries;
        Log.d("String_Node_Str","String_Node_Str" + loadMessages);
        messagesListView.setSelection(loadMessages - 1);
        resetTotalEntries();
      }
 else       if (UpdateMessagesReason.DEFAULT == updateMessagesReason) {
        Log.d("String_Node_Str","String_Node_Str");
        scrollListView();
      }
    }
  }
}
Program: 114055
Project: 114055
Buggy source:
protected void startNewMessagesLoadDialogMessages(QBDialog dialog,long lastDateLoad,String lastReadMessageID){
  if (loadingMore) {
    QBLoadDialogMessagesCommand.start(this,dialog,lastDateLoad,lastReadMessageID,ConstsCore.NOT_INITIALIZED_VALUE);
    loadingMore=false;
  }
}

Fixed version (ground truth):
protected void startNewMessagesLoadDialogMessages(QBDialog dialog,long lastDateLoad,String lastReadMessageID){
  Log.d("String_Node_Str","String_Node_Str" + loadingMore);
  if (loadingMore) {
    Log.d("String_Node_Str","String_Node_Str" + dialog + "String_Node_Str"+ lastDateLoad+ "String_Node_Str"+ skipMessages);
    QBLoadDialogMessagesCommand.start(this,dialog,lastDateLoad,lastReadMessageID,ConstsCore.NOT_INITIALIZED_VALUE);
    loadingMore=false;
  }
}
Program: 114056
Project: 114056
Buggy source:
@Override public void onConnectionChange(boolean isConnected){
  super.onConnectionChange(isConnected);
  if (!isConnected) {
    updateMessagesReason=UpdateMessagesReason.NONE;
  }
}

Fixed version (ground truth):
@Override public void onConnectionChange(boolean isConnected){
  super.onConnectionChange(isConnected);
  if (!isConnected) {
    updateMessagesReason=UpdateMessagesReason.NONE;
    showToastAboutDisconnectedIfNeed();
  }
}
Program: 114057
Project: 114057
Buggy source:
@Override public void onComplete(Bundle values,FacebookException facebookException){
  parseFacebookRequestError(values,facebookException);
}

Fixed version (ground truth):
@Override public void onComplete(Bundle values,FacebookException facebookException){
  parseFacebookFeedError(values,facebookException);
}
Program: 114058
Project: 114058
Buggy source:
public WebDialog getWebDialogRequest(){
  Bundle postParams=getBundleForFriendsRequest();
  return (new WebDialog.RequestsDialogBuilder(activity,Session.getActiveSession(),postParams)).setOnCompleteListener(getWebDialogOnCompleteListener()).build();
}

Fixed version (ground truth):
public WebDialog getWebDialogRequest(){
  Bundle postParams=getBundleForPostToWall();
  return (new WebDialog.FeedDialogBuilder(activity,Session.getActiveSession(),postParams)).setOnCompleteListener(getWebDialogOnCompleteListener()).build();
}
Program: 114059
Project: 114059
Buggy source:
private WebDialog.OnCompleteListener getWebDialogOnCompleteListener(){
  return new WebDialog.OnCompleteListener(){
    @Override public void onComplete(    Bundle values,    FacebookException facebookException){
      parseFacebookRequestError(values,facebookException);
    }
  }
;
}

Fixed version (ground truth):
private WebDialog.OnCompleteListener getWebDialogOnCompleteListener(){
  return new WebDialog.OnCompleteListener(){
    @Override public void onComplete(    Bundle values,    FacebookException facebookException){
      parseFacebookFeedError(values,facebookException);
    }
  }
;
}
Program: 114060
Project: 114060
Buggy source:
@Override protected void onStop(){
  activityHelper.onStop();
  super.onStop();
}

Fixed version (ground truth):
@Override protected void onStop(){
  isNeedShowTostAboutDisconnected=false;
  activityHelper.onStop();
  super.onStop();
}
Program: 114061
Project: 114061
Buggy source:
@Override protected void onResume(){
  super.onResume();
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  isNeedShowTostAboutDisconnected=true;
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
}
Program: 114062
Project: 114062
Buggy source:
@Override public void onConnectionChange(boolean isConnected){
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + isConnected);
  if (isConnected) {
    QBReloginCommand.start(this);
  }
 else {
    Toast.makeText(this,this.getString(com.quickblox.q_municate_core.R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@Override public void onConnectionChange(boolean isConnected){
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + isConnected);
  if (isConnected) {
    QBReloginCommand.start(this);
  }
 else {
    showToastAboutDisconnectedIfNeed();
  }
}
Program: 114063
Project: 114063
Buggy source:
@Override protected void onStart(){
  activityHelper.onStart();
  super.onStart();
}

Fixed version (ground truth):
@Override protected void onStart(){
  activityHelper.onStart();
  if (!isConnectionEnabled()) {
    Toast.makeText(this,getString(R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
  super.onStart();
}
Program: 114064
Project: 114064
Buggy source:
@Override protected void onResume(){
  super.onResume();
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
  if (!isConnectionEnabled()) {
    Toast.makeText(this,getString(R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  activityHelper.onResume();
  addAction(QBServiceConsts.LOGIN_REST_SUCCESS_ACTION,successAction);
}
Program: 114065
Project: 114065
Buggy source:
@Override protected void onStop(){
  if (!TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    ChatDatabaseManager.saveNotSendMessage(getApplicationContext(),messageEditText.getText().toString(),dialogId,null);
  }
 else {
    ChatDatabaseManager.deleteNotSentMessagesByDialogId(getApplicationContext(),dialogId);
  }
  super.onStop();
}

Fixed version (ground truth):
@Override protected void onStop(){
  isNeedShowTostAboutDisconnected=false;
  if (!TextUtils.isEmpty(messageEditText.getText().toString().trim())) {
    ChatDatabaseManager.saveNotSendMessage(getApplicationContext(),messageEditText.getText().toString(),dialogId,null);
  }
 else {
    ChatDatabaseManager.deleteNotSentMessagesByDialogId(getApplicationContext(),dialogId);
  }
  super.onStop();
}
Program: 114066
Project: 114066
Buggy source:
@Override protected void onResume(){
  super.onResume();
  Log.d("String_Node_Str","String_Node_Str");
  startLoadDialogMessages();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  isNeedShowTostAboutDisconnected=true;
  Log.d("String_Node_Str","String_Node_Str");
  startLoadDialogMessages();
}
Program: 114067
Project: 114067
Buggy source:
@Override public void onConnectionChange(boolean isConnected){
  super.onConnectionChange(isConnected);
  if (!isConnected) {
    updateMessagesReason=UpdateMessagesReason.NONE;
  }
}

Fixed version (ground truth):
@Override public void onConnectionChange(boolean isConnected){
  super.onConnectionChange(isConnected);
  if (!isConnected) {
    updateMessagesReason=UpdateMessagesReason.NONE;
    showToastAboutDisconnectedIfNeed();
  }
}
Program: 114068
Project: 114068
Buggy source:
/** 
 * Override this method in each child which need to listen connectivity state
 * @param isConnected
 */
@Override public void onConnectionChange(final boolean isConnected){
  isConnectivityExists=isConnected;
  notifyAllConnectivityListeners();
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + isConnected);
  if (isConnected) {
    QBReloginCommand.start(context);
  }
 else {
    Toast.makeText(context,context.getString(R.string.connection_lost),Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
/** 
 * Override this method in each child which need to listen connectivity state
 * @param isConnected
 */
@Override public void onConnectionChange(final boolean isConnected){
  isConnectivityExists=isConnected;
  notifyAllConnectivityListeners();
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + isConnected);
  if (isConnected) {
    QBReloginCommand.start(context);
  }
}
Program: 114069
Project: 114069
Buggy source:
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  GroupDialog groupDialog=new GroupDialog(dialog);
  List<Integer> participantIdsList=dialog.getOccupants();
  try {
    List<Integer> onlineParticipantIdsList=multiChatHelper.getRoomOnlineParticipantList(dialog.getRoomJid());
    QBPagedRequestBuilder requestBuilder=new QBPagedRequestBuilder();
    requestBuilder.setPage(ConstsCore.FL_FRIENDS_PAGE_NUM);
    requestBuilder.setPerPage(ConstsCore.FL_FRIENDS_PER_PAGE);
    Bundle requestParams=new Bundle();
    List<QBUser> userList=QBUsers.getUsersByIDs(participantIdsList,requestBuilder,requestParams);
    Map<Integer,User> friendMap=FriendUtils.createUserMap(userList);
    for (    Integer onlineParticipantId : onlineParticipantIdsList) {
      User user=friendMap.get(onlineParticipantId);
      if (user != null) {
        user.setOnline(true);
      }
    }
    ArrayList<User> friendList=new ArrayList<User>(friendMap.values());
    Collections.sort(friendList,new UserComparator());
    groupDialog.setOccupantList(friendList);
  }
 catch (  XMPPException e) {
    throw new QBResponseException(e.getLocalizedMessage());
  }
  Bundle params=new Bundle();
  params.putSerializable(QBServiceConsts.EXTRA_GROUP_DIALOG,groupDialog);
  return params;
}

Fixed version (ground truth):
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  GroupDialog groupDialog=new GroupDialog(dialog);
  List<Integer> participantIdsList=dialog.getOccupants();
  try {
    List<Integer> onlineParticipantIdsList=multiChatHelper.getRoomOnlineParticipantList(dialog.getRoomJid());
    QBPagedRequestBuilder requestBuilder=new QBPagedRequestBuilder();
    requestBuilder.setPage(ConstsCore.FL_FRIENDS_PAGE_NUM);
    requestBuilder.setPerPage(ConstsCore.FL_FRIENDS_PER_PAGE_TEMP_VALUE);
    Bundle requestParams=new Bundle();
    List<QBUser> userList=QBUsers.getUsersByIDs(participantIdsList,requestBuilder,requestParams);
    Map<Integer,User> friendMap=FriendUtils.createUserMap(userList);
    for (    Integer onlineParticipantId : onlineParticipantIdsList) {
      User user=friendMap.get(onlineParticipantId);
      if (user != null) {
        user.setOnline(true);
      }
    }
    ArrayList<User> friendList=new ArrayList<User>(friendMap.values());
    Collections.sort(friendList,new UserComparator());
    groupDialog.setOccupantList(friendList);
  }
 catch (  XMPPException e) {
    throw new QBResponseException(e.getLocalizedMessage());
  }
  Bundle params=new Bundle();
  params.putSerializable(QBServiceConsts.EXTRA_GROUP_DIALOG,groupDialog);
  return params;
}
Program: 114070
Project: 114070
Buggy source:
protected void showUserAgreement(DialogInterface.OnClickListener positiveClickListener,DialogInterface.OnClickListener negativeClickListener){
  if (userAgreementDialog == null) {
    userAgreementDialog=UserAgreementDialog.newInstance(positiveClickListener,negativeClickListener);
  }
  userAgreementDialog.show(getFragmentManager(),null);
}

Fixed version (ground truth):
protected void showUserAgreement(DialogInterface.OnClickListener positiveClickListener,DialogInterface.OnClickListener negativeClickListener){
  UserAgreementDialog userAgreementDialog=UserAgreementDialog.newInstance(positiveClickListener,negativeClickListener);
  userAgreementDialog.show(getFragmentManager(),null);
}
Program: 114071
Project: 114071
Buggy source:
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  GroupDialog groupDialog=new GroupDialog(dialog);
  List<Integer> participantIdsList=dialog.getOccupants();
  try {
    List<Integer> onlineParticipantIdsList=multiChatHelper.getRoomOnlineParticipantList(dialog.getRoomJid());
    QBPagedRequestBuilder requestBuilder=new QBPagedRequestBuilder();
    requestBuilder.setPage(ConstsCore.FL_FRIENDS_PAGE_NUM);
    requestBuilder.setPerPage(ConstsCore.FL_FRIENDS_PER_PAGE);
    Bundle requestParams=new Bundle();
    List<QBUser> userList=QBUsers.getUsersByIDs(participantIdsList,requestBuilder,requestParams);
    Map<Integer,User> friendMap=FriendUtils.createUserMap(userList);
    for (    Integer onlineParticipantId : onlineParticipantIdsList) {
      User user=friendMap.get(onlineParticipantId);
      if (user != null) {
        user.setOnline(true);
      }
    }
    ArrayList<User> friendList=new ArrayList<User>(friendMap.values());
    Collections.sort(friendList,new UserComparator());
    groupDialog.setOccupantList(friendList);
  }
 catch (  XMPPException e) {
    throw new QBResponseException(e.getLocalizedMessage());
  }
  Bundle params=new Bundle();
  params.putSerializable(QBServiceConsts.EXTRA_GROUP_DIALOG,groupDialog);
  return params;
}

Fixed version (ground truth):
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  GroupDialog groupDialog=new GroupDialog(dialog);
  List<Integer> participantIdsList=dialog.getOccupants();
  try {
    List<Integer> onlineParticipantIdsList=multiChatHelper.getRoomOnlineParticipantList(dialog.getRoomJid());
    QBPagedRequestBuilder requestBuilder=new QBPagedRequestBuilder();
    requestBuilder.setPage(ConstsCore.FL_FRIENDS_PAGE_NUM);
    requestBuilder.setPerPage(ConstsCore.FL_FRIENDS_PER_PAGE_TEMP_VALUE);
    Bundle requestParams=new Bundle();
    List<QBUser> userList=QBUsers.getUsersByIDs(participantIdsList,requestBuilder,requestParams);
    Map<Integer,User> friendMap=FriendUtils.createUserMap(userList);
    for (    Integer onlineParticipantId : onlineParticipantIdsList) {
      User user=friendMap.get(onlineParticipantId);
      if (user != null) {
        user.setOnline(true);
      }
    }
    ArrayList<User> friendList=new ArrayList<User>(friendMap.values());
    Collections.sort(friendList,new UserComparator());
    groupDialog.setOccupantList(friendList);
  }
 catch (  XMPPException e) {
    throw new QBResponseException(e.getLocalizedMessage());
  }
  Bundle params=new Bundle();
  params.putSerializable(QBServiceConsts.EXTRA_GROUP_DIALOG,groupDialog);
  return params;
}
Program: 114072
Project: 114072
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    messagesAdapter.changeCursor(messagesCursor);
    if (totalEntries > 0 && updateMessagesReason == UpdateMessagesReason.ON_USER_REQUEST) {
      messagesListView.setSelection(totalEntries - 1);
    }
 else     if (totalEntries > 0 && updateMessagesReason == UpdateMessagesReason.DEFAULT) {
      scrollListView();
    }
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  Log.d("String_Node_Str","String_Node_Str");
  Log.d("String_Node_Str","String_Node_Str" + messagesAdapter);
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    Log.d("String_Node_Str","String_Node_Str" + updateMessagesReason);
    messagesAdapter.changeCursor(messagesCursor);
    if (totalEntries > 0 && updateMessagesReason == UpdateMessagesReason.ON_USER_REQUEST) {
      messagesListView.setSelection(totalEntries - 1);
    }
 else     if (totalEntries > 0 && updateMessagesReason == UpdateMessagesReason.DEFAULT) {
      scrollListView();
    }
  }
}
Program: 114073
Project: 114073
Buggy source:
@Override protected void initListView(Cursor messagesCursor){
  messagesAdapter=new GroupDialogMessagesAdapter(this,messagesCursor,this,dialog);
  messagesListView.setAdapter((StickyListHeadersAdapter)messagesAdapter);
  isNeedToScrollMessages=true;
  scrollListView();
}

Fixed version (ground truth):
@Override protected void initListView(Cursor messagesCursor){
  messagesAdapter=new GroupDialogMessagesAdapter(this,messagesCursor,this,dialog);
  messagesListView.setAdapter((StickyListHeadersAdapter)messagesAdapter);
  isNeedToScrollMessages=true;
}
Program: 114074
Project: 114074
Buggy source:
@Override protected void initListView(Cursor messagesCursor){
  messagesAdapter=new PrivateDialogMessagesAdapter(this,friendOperationAction,messagesCursor,this,dialog);
  messagesListView.setAdapter((StickyListHeadersAdapter)messagesAdapter);
  ((PrivateDialogMessagesAdapter)messagesAdapter).findLastFriendsRequestMessagesPosition();
  isNeedToScrollMessages=true;
  scrollListView();
}

Fixed version (ground truth):
@Override protected void initListView(Cursor messagesCursor){
  messagesAdapter=new PrivateDialogMessagesAdapter(this,friendOperationAction,messagesCursor,this,dialog);
  messagesListView.setAdapter((StickyListHeadersAdapter)messagesAdapter);
  ((PrivateDialogMessagesAdapter)messagesAdapter).findLastFriendsRequestMessagesPosition();
  isNeedToScrollMessages=true;
}
Program: 114075
Project: 114075
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long arg3){
  Cursor selectedChatCursor=(Cursor)dialogsAdapter.getItem(position);
  QBDialog dialog=ChatDatabaseManager.getDialogFromCursor(selectedChatCursor);
  if (dialog.getType() == QBDialogType.PRIVATE) {
    startPrivateChatActivity(dialog);
  }
 else {
    startGroupChatActivity(dialog);
  }
  selectedPositionList=position;
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long arg3){
  Cursor selectedChatCursor=(Cursor)dialogsAdapter.getItem(position);
  QBDialog dialog=ChatDatabaseManager.getDialogFromCursor(selectedChatCursor);
  if (dialog.getType() == QBDialogType.PRIVATE) {
    startPrivateChatActivity(dialog);
  }
 else {
    startGroupChatActivity(dialog);
  }
  selectedPositionList=dialogsListView.getFirstVisiblePosition();
}
Program: 114076
Project: 114076
Buggy source:
private void initListeners(){
  dialogsListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long arg3){
      Cursor selectedChatCursor=(Cursor)dialogsAdapter.getItem(position);
      QBDialog dialog=ChatDatabaseManager.getDialogFromCursor(selectedChatCursor);
      if (dialog.getType() == QBDialogType.PRIVATE) {
        startPrivateChatActivity(dialog);
      }
 else {
        startGroupChatActivity(dialog);
      }
      selectedPositionList=position;
    }
  }
);
}

Fixed version (ground truth):
private void initListeners(){
  dialogsListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long arg3){
      Cursor selectedChatCursor=(Cursor)dialogsAdapter.getItem(position);
      QBDialog dialog=ChatDatabaseManager.getDialogFromCursor(selectedChatCursor);
      if (dialog.getType() == QBDialogType.PRIVATE) {
        startPrivateChatActivity(dialog);
      }
 else {
        startGroupChatActivity(dialog);
      }
      selectedPositionList=dialogsListView.getFirstVisiblePosition();
    }
  }
);
}
Program: 114077
Project: 114077
Buggy source:
@Override public void onReceiveHangUpFromUser(Integer integer){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (!isCleintReadyAccept) {
    waitingTasksMap.clear();
    finish();
  }
  if (currentFragment instanceof IncomingCallFragment || currentFragment instanceof OutgoingCallFragment) {
    showToastMessage(getString(R.string.user_hang_up_call));
  }
}

Fixed version (ground truth):
@Override public void onReceiveHangUpFromUser(Integer integer){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (currentFragment instanceof IncomingCallFragment || currentFragment instanceof OutgoingCallFragment) {
    showToastMessage(getString(R.string.user_hang_up_call));
  }
}
Program: 114078
Project: 114078
Buggy source:
/** 
 * Start call rejecting task
 */
@Override public void rejectCallClick(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  if (isCleintReadyAccept) {
    Runnable rejectTask=callTasksMap.get(REJECT_CALL_TASK);
    executeCallTask(rejectTask);
  }
 else {
    waitingTasksMap.put(REJECT_CALL_TASK,callTasksMap.get(REJECT_CALL_TASK));
  }
}

Fixed version (ground truth):
/** 
 * Start call rejecting task
 */
@Override public void rejectCallClick(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  Runnable rejectTask=callTasksMap.get(REJECT_CALL_TASK);
  executeCallTask(rejectTask);
}
Program: 114079
Project: 114079
Buggy source:
/** 
 * Start call accepting task
 */
@Override public void acceptCallClick(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  showOutgoingFragment();
  if (isCleintReadyAccept) {
    Runnable acceptTask=callTasksMap.get(ACCEPT_CALL_TASK);
    executeCallTask(acceptTask);
  }
 else {
    waitingTasksMap.put(ACCEPT_CALL_TASK,callTasksMap.get(ACCEPT_CALL_TASK));
  }
}

Fixed version (ground truth):
/** 
 * Start call accepting task
 */
@Override public void acceptCallClick(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  showOutgoingFragment();
  Runnable acceptTask=callTasksMap.get(ACCEPT_CALL_TASK);
  executeCallTask(acceptTask);
}
Program: 114080
Project: 114080
Buggy source:
@Override public void onSessionClosed(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  finish();
}

Fixed version (ground truth):
@Override public void onSessionClosed(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  stopIncomeCallTimer();
  finish();
}
Program: 114081
Project: 114081
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  QBRTCClient.getInstance().prepareToProcessCalls(this);
  if (getIntent().getExtras() != null) {
    parseIntentExtras(getIntent().getExtras());
  }
  canPerformLogout.set(false);
  setContentView(R.layout.activity_main_call);
  actionBar.hide();
  mediaPlayer=App.getInstance().getMediaPlayer();
  callTasksQueue=new LinkedList<>();
  videoTracksSetEnumMap=new EnumMap<>(VideoTracks.class);
  for (  VideoTracks videoTracks : VideoTracks.values()) {
    videoTracksSetEnumMap.put(videoTracks,new HashSet<Runnable>());
  }
  waitingTasksMap=new TreeMap<>();
  initCallTasksMap();
  if (call_direction_type == ConstsCore.CALL_DIRECTION_TYPE.OUTGOING) {
    startCall();
  }
  addAction(QBServiceConsts.SEND_PUSH_MESSAGES_FAIL_ACTION,failAction);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  if (getIntent().getExtras() != null) {
    parseIntentExtras(getIntent().getExtras());
  }
  canPerformLogout.set(false);
  setContentView(R.layout.activity_main_call);
  actionBar.hide();
  mediaPlayer=App.getInstance().getMediaPlayer();
  callTasksQueue=new LinkedList<>();
  videoTracksSetEnumMap=new EnumMap<>(VideoTracks.class);
  for (  VideoTracks videoTracks : VideoTracks.values()) {
    videoTracksSetEnumMap.put(videoTracks,new HashSet<Runnable>());
  }
  initCallTasksMap();
  if (call_direction_type == ConstsCore.CALL_DIRECTION_TYPE.OUTGOING) {
    startCall();
  }
  addAction(QBServiceConsts.SEND_PUSH_MESSAGES_FAIL_ACTION,failAction);
}
Program: 114082
Project: 114082
Buggy source:
@Override protected void onDestroy(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  stopIncomeCallTimer();
  cancelPlayer();
  if (QBRTCClient.isInitiated()) {
    QBRTCClient.getInstance().close(true);
  }
  if (videoChatHelper != null) {
    videoChatHelper.setClientClosed();
    videoChatHelper.removeVideoChatHelperListener(this);
  }
  super.onDestroy();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  stopCall();
}
Program: 114083
Project: 114083
Buggy source:
/** 
 * Start call task
 */
public void startCall(){
  if (waitingTasksMap != null && !waitingTasksMap.containsKey(REJECT_CALL_TASK)) {
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    Runnable callTask=callTasksMap.get(START_CALL_TASK);
    executeCallTask(callTask);
  }
}

Fixed version (ground truth):
/** 
 * Start call task
 */
public void startCall(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  Runnable callTask=callTasksMap.get(START_CALL_TASK);
  executeCallTask(callTask);
}
Program: 114084
Project: 114084
Buggy source:
private void initChatData(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (call_direction_type != null) {
    return;
  }
  call_direction_type=(ConstsCore.CALL_DIRECTION_TYPE)getArguments().getSerializable(ConstsCore.CALL_DIRECTION_TYPE_EXTRA);
  opponent=(User)getArguments().getSerializable(ConstsCore.EXTRA_FRIEND);
  call_type=(QBRTCTypes.QBConferenceType)getArguments().getSerializable(ConstsCore.CALL_TYPE_EXTRA);
  sessionId=getArguments().getString(ConstsCore.SESSION_ID,"String_Node_Str");
}

Fixed version (ground truth):
private void initChatData(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (call_direction_type != null) {
    return;
  }
  call_direction_type=(ConstsCore.CALL_DIRECTION_TYPE)getArguments().getSerializable(ConstsCore.CALL_DIRECTION_TYPE_EXTRA);
  opponent=(User)getArguments().getSerializable(ConstsCore.EXTRA_FRIEND);
}
Program: 114085
Project: 114085
Buggy source:
@Override public void onConnectedToUser(QBRTCSession qbrtcSession,Integer integer){
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      ((CallActivity)getActivity()).stopIncomeCallTimer();
      startTimer(timerTextView);
      setActionButtonsEnability(true);
      QBGLVideoView localVideoView=((CallActivity)getActivity()).getLocalVideoView();
      if (localVideoView != null) {
      }
      QBGLVideoView remoteView=((CallActivity)getActivity()).getRemoteVideoView();
      if (remoteView != null) {
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onConnectedToUser(QBRTCSession qbrtcSession,Integer integer){
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      ((CallActivity)getActivity()).stopIncomeCallTimer();
      startTimer(timerTextView);
      setActionButtonsEnability(true);
    }
  }
);
}
Program: 114086
Project: 114086
Buggy source:
@Override public void onPause(){
  if (isCallStopped()) {
    toggleCamera(false);
    if (cameraState == null) {
      cameraState=CameraState.NONE;
    }
  }
  super.onPause();
}

Fixed version (ground truth):
@Override public void onPause(){
  if (!isCallStopped()) {
    toggleCamera(false);
    if (cameraState == null) {
      cameraState=CameraState.NONE;
    }
  }
  super.onPause();
}
Program: 114087
Project: 114087
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    messagesAdapter.changeCursor(messagesCursor);
    if (totalEntries > 0) {
      messagesListView.setSelection(totalEntries);
    }
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    messagesAdapter.changeCursor(messagesCursor);
    if (totalEntries > 0) {
      messagesListView.setSelection(totalEntries - 1);
    }
  }
}
Program: 114088
Project: 114088
Buggy source:
@Override protected void onResume(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onResume();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onResume();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onResume();
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onResume();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onResume();
  }
  if (getRemoteVideoView() != null) {
    getRemoteVideoView().onResume();
  }
}
Program: 114089
Project: 114089
Buggy source:
@Override protected void onPause(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onPause();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onPause();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onPause();
  }
}

Fixed version (ground truth):
@Override protected void onPause(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onPause();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onPause();
  }
  if (getRemoteVideoView() != null) {
    getRemoteVideoView().onPause();
  }
}
Program: 114090
Project: 114090
Buggy source:
private Runnable initHangUpCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      try {
        videoChatHelper.hangUpCall(userInfo);
      }
 catch (      QBRTCSessionIsAbsentException e) {
        CallActivity.this.finish();
        Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable initHangUpCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      try {
        videoChatHelper.hangUpCall(userInfo);
      }
 catch (      QBRTCSessionIsAbsentException e) {
        videoChatHelper.setVideoChatHelperState(QBVideoChatHelper.VideoHelperStates.WAIT_FOR_CALL);
        CallActivity.this.finish();
        Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
      }
    }
  }
;
}
Program: 114091
Project: 114091
Buggy source:
/** 
 * Executes all scheduled tasks as soon as we receive QBVideoChatHelper instance
 */
private void executeScheduledTasks(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  for (  Runnable task : callTasksQueue) {
    runOnUiThread(task);
  }
}

Fixed version (ground truth):
/** 
 * Executes all scheduled tasks as soon as we receive QBVideoChatHelper instance
 */
private void executeScheduledTasks(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (videoChatHelper != null) {
    for (    Runnable task : callTasksQueue) {
      runOnUiThread(task);
    }
  }
}
Program: 114092
Project: 114092
Buggy source:
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.muteDynamicButton:
    switchAudioOutput();
  break;
case R.id.stopСallButton:
setActionButtonsEnability(false);
stopСallButton.setEnabled(false);
stopСallButton.setActivated(false);
stopCall();
Log.d("String_Node_Str","String_Node_Str");
break;
case R.id.muteMicrophoneButton:
toggleMicrophone();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.muteDynamicButton:
    switchAudioOutput();
  break;
case R.id.stopСallButton:
setCallState(true);
setActionButtonsEnability(false);
stopСallButton.setEnabled(false);
stopСallButton.setActivated(false);
stopCall();
Log.d("String_Node_Str","String_Node_Str");
break;
case R.id.muteMicrophoneButton:
toggleMicrophone();
break;
default :
break;
}
}
Program: 114093
Project: 114093
Buggy source:
private void toggleCamera(boolean isCameraEnabled){
  if (outgoingCallFragmentInterface != null) {
    DisplayMetrics displaymetrics=new DisplayMetrics();
    displaymetrics.setToDefaults();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
    ViewGroup.LayoutParams layoutParams=imgMyCameraOff.getLayoutParams();
    int videoViewHeight=localVideoView.getHeight();
    int videoViewWidth=localVideoView.getWidth();
    layoutParams.height=videoViewHeight;
    layoutParams.width=videoViewWidth;
    imgMyCameraOff.setLayoutParams(layoutParams);
    if (!isCameraEnabled) {
      switchCameraButton.setVisibility(View.INVISIBLE);
      cameraOffButton.setChecked(true);
      imgMyCameraOff.setVisibility(View.VISIBLE);
      Log.d(TAG,"String_Node_Str");
      outgoingCallFragmentInterface.offCam();
    }
 else {
      switchCameraButton.setVisibility(View.VISIBLE);
      cameraOffButton.setChecked(false);
      imgMyCameraOff.setVisibility(View.INVISIBLE);
      Log.d(TAG,"String_Node_Str");
      outgoingCallFragmentInterface.onCam();
    }
  }
}

Fixed version (ground truth):
private void toggleCamera(boolean isCameraEnabled){
  if (outgoingCallFragmentInterface != null) {
    ViewGroup.LayoutParams layoutParams=imgMyCameraOff.getLayoutParams();
    int videoViewHeight=localVideoView.getHeight();
    int videoViewWidth=localVideoView.getWidth();
    layoutParams.height=videoViewHeight;
    layoutParams.width=videoViewWidth;
    imgMyCameraOff.setLayoutParams(layoutParams);
    if (!isCameraEnabled) {
      switchCameraButton.setVisibility(View.INVISIBLE);
      cameraOffButton.setChecked(true);
      imgMyCameraOff.setVisibility(View.VISIBLE);
      Log.d(TAG,"String_Node_Str");
      outgoingCallFragmentInterface.offCam();
    }
 else {
      switchCameraButton.setVisibility(View.VISIBLE);
      cameraOffButton.setChecked(false);
      imgMyCameraOff.setVisibility(View.INVISIBLE);
      Log.d(TAG,"String_Node_Str");
      outgoingCallFragmentInterface.onCam();
    }
  }
}
Program: 114094
Project: 114094
Buggy source:
@Override public void onPause(){
  toggleCamera(false);
  if (cameraState == null) {
    cameraState=CameraState.NONE;
  }
  super.onPause();
}

Fixed version (ground truth):
@Override public void onPause(){
  if (isCallStopped()) {
    toggleCamera(false);
    if (cameraState == null) {
      cameraState=CameraState.NONE;
    }
  }
  super.onPause();
}
Program: 114096
Project: 114096
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  isPushForbidden=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_NOTIFICATIONS,false);
  if (isPushForbidden) {
    return;
  }
  ComponentName comp=new ComponentName(context.getPackageName(),GCMIntentService.class.getName());
  startWakefulService(context,(intent.setComponent(comp)));
  setResultCode(Activity.RESULT_OK);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  isPushForbidden=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_NOTIFICATIONS,false) || PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_NOTIFICATIONS_ON_LOGOUT,false);
  Log.i("String_Node_Str","String_Node_Str" + isPushForbidden);
  if (isPushForbidden) {
    return;
  }
  ComponentName comp=new ComponentName(context.getPackageName(),GCMIntentService.class.getName());
  startWakefulService(context,(intent.setComponent(comp)));
  setResultCode(Activity.RESULT_OK);
}
Program: 114097
Project: 114097
Buggy source:
public static void start(Context context){
  Intent intent=new Intent(context,MainActivity.class);
  context.startActivity(intent);
}

Fixed version (ground truth):
public static void start(Context context){
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_NOTIFICATIONS_ON_LOGOUT,false);
  Intent intent=new Intent(context,MainActivity.class);
  context.startActivity(intent);
}
Program: 114098
Project: 114098
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  baseActivity.showProgress();
  FacebookHelper.logout();
  QBLogoutCommand.start(baseActivity);
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_NOTIFICATIONS_ON_LOGOUT,true);
  baseActivity.showProgress();
  FacebookHelper.logout();
  QBLogoutCommand.start(baseActivity);
}
Program: 114099
Project: 114099
Buggy source:
private void logout(){
  ConfirmDialog dialog=ConfirmDialog.newInstance(R.string.dlg_logout,R.string.dlg_confirm);
  dialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      baseActivity.showProgress();
      FacebookHelper.logout();
      QBLogoutCommand.start(baseActivity);
    }
  }
);
  dialog.show(getFragmentManager(),null);
}

Fixed version (ground truth):
private void logout(){
  ConfirmDialog dialog=ConfirmDialog.newInstance(R.string.dlg_logout,R.string.dlg_confirm);
  dialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_NOTIFICATIONS_ON_LOGOUT,true);
      baseActivity.showProgress();
      FacebookHelper.logout();
      QBLogoutCommand.start(baseActivity);
    }
  }
);
  dialog.show(getFragmentManager(),null);
}
Program: 114100
Project: 114100
Buggy source:
@Override protected void onStop(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  super.onStop();
  if (videoChatHelper != null) {
    try {
      videoChatHelper.setCamState(false);
    }
 catch (    QBRTCSessionIsAbsentException e) {
      Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override protected void onStop(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onStop();
  if (videoChatHelper != null) {
    try {
      videoChatHelper.setCamState(false);
    }
 catch (    QBRTCSessionIsAbsentException e) {
      Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
    }
  }
}
Program: 114101
Project: 114101
Buggy source:
@Override public void onReceiveHangUpFromUser(Integer integer){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  showToastMessage(getString(R.string.user_hang_up_call));
}

Fixed version (ground truth):
@Override public void onReceiveHangUpFromUser(Integer integer){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (!isCleintReadyAccept) {
    waitingTasksMap.clear();
    finish();
  }
  if (currentFragment instanceof IncomingCallFragment || currentFragment instanceof OutgoingCallFragment) {
    showToastMessage(getString(R.string.user_hang_up_call));
  }
}
Program: 114102
Project: 114102
Buggy source:
@Override protected void onResume(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  super.onResume();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onResume();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onResume();
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onResume();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onResume();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onResume();
  }
}
Program: 114103
Project: 114103
Buggy source:
@Override protected void onPause(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  super.onPause();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onPause();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onPause();
  }
}

Fixed version (ground truth):
@Override protected void onPause(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  super.onPause();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onPause();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onPause();
  }
}
Program: 114104
Project: 114104
Buggy source:
private Runnable initHangUpCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      try {
        videoChatHelper.hangUpCall(userInfo);
      }
 catch (      QBRTCSessionIsAbsentException e) {
        Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable initHangUpCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      try {
        videoChatHelper.hangUpCall(userInfo);
      }
 catch (      QBRTCSessionIsAbsentException e) {
        CallActivity.this.finish();
        Log.d(CALL_INTEGRATION,e.getMessage() + "String_Node_Str");
      }
    }
  }
;
}
Program: 114105
Project: 114105
Buggy source:
@Override protected void onDestroy(){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  cancelPlayer();
  super.onDestroy();
  if (QBRTCClient.isInitiated()) {
    QBRTCClient.getInstance().close(true);
  }
  if (videoChatHelper != null) {
    videoChatHelper.setClientClosed();
    videoChatHelper.removeVideoChatHelperListener(this);
  }
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  Log.d(CALL_INTEGRATION,"String_Node_Str" + this);
  stopIncomeCallTimer();
  cancelPlayer();
  if (QBRTCClient.isInitiated()) {
    QBRTCClient.getInstance().close(true);
  }
  if (videoChatHelper != null) {
    videoChatHelper.setClientClosed();
    videoChatHelper.removeVideoChatHelperListener(this);
  }
  super.onDestroy();
}