nus-yam/ex-repair huggingface dataset:
Program: 114106
Project: 114106
Buggy source:
public void stopCall(){
  if (outgoingCallFragmentInterface != null) {
    outgoingCallFragmentInterface.hungUpClick();
  }
  stopTimer();
}

Fixed version (ground truth):
public void stopCall(){
  if (outgoingCallFragmentInterface != null) {
    outgoingCallFragmentInterface.hungUpClick();
  }
  stopTimer();
  Log.d(CALL_INTEGRATION,"String_Node_Str" + getActivity());
}
Program: 114107
Project: 114107
Buggy source:
@Override public void onChange(boolean selfChange){
  selectedPositionList=dialogsListView.getFirstVisiblePosition();
  initCursorLoaders();
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  initCursorLoaders();
}
Program: 114108
Project: 114108
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);
  }
}

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=position;
}
Program: 114109
Project: 114109
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_dialogs_list,container,false);
  initUI(view);
  initListeners();
  Crouton.cancelAllCroutons();
  addActions();
  initCursorLoaders();
  registerForContextMenu(dialogsListView);
  registerContentObservers();
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_dialogs_list,container,false);
  if (savedInstanceState != null) {
    selectedPositionList=savedInstanceState.getInt(ConstsCore.LAST_CLICKED_DIALOG);
  }
  initUI(view);
  initListeners();
  Crouton.cancelAllCroutons();
  addActions();
  initCursorLoaders();
  registerForContextMenu(dialogsListView);
  registerContentObservers();
  return view;
}
Program: 114110
Project: 114110
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);
      }
    }
  }
);
}

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=position;
    }
  }
);
}
Program: 114111
Project: 114111
Buggy source:
private void registerContentObservers(){
  userTableContentObserver=new ContentObserver(new Handler()){
    @Override public void onChange(    boolean selfChange){
      selectedPositionList=dialogsListView.getFirstVisiblePosition();
      initCursorLoaders();
    }
  }
;
  baseActivity.getContentResolver().registerContentObserver(UserTable.CONTENT_URI,true,userTableContentObserver);
}

Fixed version (ground truth):
private void registerContentObservers(){
  userTableContentObserver=new ContentObserver(new Handler()){
    @Override public void onChange(    boolean selfChange){
      initCursorLoaders();
    }
  }
;
  baseActivity.getContentResolver().registerContentObserver(UserTable.CONTENT_URI,true,userTableContentObserver);
}
Program: 114112
Project: 114112
Buggy source:
private void saveOpeningDialogData(int userId,String dialogId){
  PrefsHelper prefsHelper=PrefsHelper.getPrefsHelper();
  if (userId != ConstsCore.ZERO_INT_VALUE && !TextUtils.isEmpty(dialogId)) {
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_USER_ID,userId);
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_DIALOG_ID,dialogId);
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,true);
  }
 else {
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  }
}

Fixed version (ground truth):
private void saveOpeningDialogData(int userId,String dialogId){
  PrefsHelper prefsHelper=PrefsHelper.getPrefsHelper();
  if (userId != ConstsCore.ZERO_INT_VALUE && !TextUtils.isEmpty(dialogId)) {
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_USER_ID,userId);
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_DIALOG_ID,dialogId);
    Log.d("String_Node_Str","String_Node_Str");
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,true);
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  }
}
Program: 114113
Project: 114113
Buggy source:
@Override protected void onResume(){
  super.onResume();
  boolean isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isNeedToOpenDialog) {
    finish();
  }
  if (skipMessages == ConstsCore.ZERO_INT_VALUE) {
    startLoadDialogMessages();
  }
 else {
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  boolean isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isNeedToOpenDialog) {
  }
  if (skipMessages == ConstsCore.ZERO_INT_VALUE) {
    startLoadDialogMessages();
  }
 else {
  }
}
Program: 114114
Project: 114114
Buggy source:
@Override public void onChange(boolean selfChange){
  selectedPositionList=dialogsListView.getFirstVisiblePosition();
  initCursorLoaders();
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange){
  initCursorLoaders();
}
Program: 114115
Project: 114115
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);
  }
}

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=position;
}
Program: 114116
Project: 114116
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_dialogs_list,container,false);
  initUI(view);
  initListeners();
  Crouton.cancelAllCroutons();
  addActions();
  initCursorLoaders();
  registerForContextMenu(dialogsListView);
  registerContentObservers();
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_dialogs_list,container,false);
  if (savedInstanceState != null) {
    selectedPositionList=savedInstanceState.getInt(ConstsCore.LAST_CLICKED_DIALOG);
  }
  initUI(view);
  initListeners();
  Crouton.cancelAllCroutons();
  addActions();
  initCursorLoaders();
  registerForContextMenu(dialogsListView);
  registerContentObservers();
  return view;
}
Program: 114117
Project: 114117
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);
      }
    }
  }
);
}

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=position;
    }
  }
);
}
Program: 114118
Project: 114118
Buggy source:
private void registerContentObservers(){
  userTableContentObserver=new ContentObserver(new Handler()){
    @Override public void onChange(    boolean selfChange){
      selectedPositionList=dialogsListView.getFirstVisiblePosition();
      initCursorLoaders();
    }
  }
;
  baseActivity.getContentResolver().registerContentObserver(UserTable.CONTENT_URI,true,userTableContentObserver);
}

Fixed version (ground truth):
private void registerContentObservers(){
  userTableContentObserver=new ContentObserver(new Handler()){
    @Override public void onChange(    boolean selfChange){
      initCursorLoaders();
    }
  }
;
  baseActivity.getContentResolver().registerContentObserver(UserTable.CONTENT_URI,true,userTableContentObserver);
}
Program: 114119
Project: 114119
Buggy source:
private void startDialog(){
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  String dialogId=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_DIALOG_ID,null);
  long userId=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_USER_ID,ConstsCore.NOT_INITIALIZED_VALUE);
  QBDialog dialog=ChatDatabaseManager.getDialogByDialogId(this,dialogId);
  if (dialog.getType() == QBDialogType.PRIVATE) {
    startPrivateChatActivity(dialog,userId);
  }
 else {
    startGroupChatActivity(dialog);
  }
}

Fixed version (ground truth):
private void startDialog(){
  Log.d("String_Node_Str","String_Node_Str");
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  String dialogId=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_DIALOG_ID,null);
  long userId=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_USER_ID,ConstsCore.NOT_INITIALIZED_VALUE);
  QBDialog dialog=ChatDatabaseManager.getDialogByDialogId(this,dialogId);
  if (dialog.getType() == QBDialogType.PRIVATE) {
    startPrivateChatActivity(dialog,userId);
  }
 else {
    startGroupChatActivity(dialog);
  }
}
Program: 114120
Project: 114120
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(QBServiceConsts.UPDATE_DIALOG)) {
    updateDialogData();
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(QBServiceConsts.UPDATE_DIALOG)) {
  }
}
Program: 114121
Project: 114121
Buggy source:
protected void scrollListView(){
  if (isNeedToScrollMessages) {
    isNeedToScrollMessages=false;
    messagesListView.setSelection(messagesAdapter.getCount() - 1);
  }
}

Fixed version (ground truth):
protected void scrollListView(){
  isNeedToScrollMessages=false;
  messagesListView.setSelection(messagesAdapter.getCount() - 1);
}
Program: 114122
Project: 114122
Buggy source:
@Override protected void onResume(){
  super.onResume();
  boolean isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isNeedToOpenDialog) {
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  boolean isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isNeedToOpenDialog) {
  }
  if (skipMessages == ConstsCore.ZERO_INT_VALUE) {
    startLoadDialogMessages();
  }
 else {
  }
}
Program: 114123
Project: 114123
Buggy source:
private void initUI(){
  emojisFragment=_findViewById(R.id.emojicons_fragment);
  chatEditText=_findViewById(R.id.message_edittext);
  messagesListView=_findViewById(R.id.messages_listview);
  messageEditText=_findViewById(R.id.message_edittext);
  sendButton=_findViewById(R.id.send_button);
  smilePanelImageButton=_findViewById(R.id.smile_panel_imagebutton);
  sendButton.setEnabled(false);
  messageTextView=_findViewById(R.id.message_textview);
  messageTypingView=_findViewById(R.id.message_typing_view);
  messageTypingBoxImageView=_findViewById(R.id.message_typing_box_imageview);
  messageTypingAnimationDrawable=(AnimationDrawable)messageTypingBoxImageView.getDrawable();
  loadMoreView=_findViewById(R.id.load_more_linearlayout);
  loadMoreView.setVisibility(View.GONE);
  messagesListView.setOnScrollListener(this);
}

Fixed version (ground truth):
private void initUI(){
  emojisFragment=_findViewById(R.id.emojicons_fragment);
  chatEditText=_findViewById(R.id.message_edittext);
  messagesListView=_findViewById(R.id.messages_listview);
  messageEditText=_findViewById(R.id.message_edittext);
  sendButton=_findViewById(R.id.send_button);
  smilePanelImageButton=_findViewById(R.id.smile_panel_imagebutton);
  sendButton.setEnabled(false);
  messageTextView=_findViewById(R.id.message_textview);
  messageTypingView=_findViewById(R.id.message_typing_view);
  messageTypingBoxImageView=_findViewById(R.id.message_typing_box_imageview);
  messageTypingAnimationDrawable=(AnimationDrawable)messageTypingBoxImageView.getDrawable();
  messagesListView.setOnScrollListener(this);
}
Program: 114124
Project: 114124
Buggy source:
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  firstVisiblePosition=firstVisibleItem;
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  firstVisiblePosition=firstVisibleItem;
  lastVisiblePosition=firstVisibleItem + visibleItemCount;
  this.visibleItemCount=visibleItemCount;
}
Program: 114125
Project: 114125
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor messagesCursor){
  if (messagesAdapter == null) {
    initListView(messagesCursor);
  }
 else {
    messagesAdapter.swapCursor(messagesCursor);
  }
}

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);
    }
  }
}
Program: 114126
Project: 114126
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  rootView=getLayoutInflater().inflate(layoutResID,null);
  setContentView(rootView);
  resources=getResources();
  imageUtils=new ImageUtils(this);
  loadAttachFileSuccessAction=new LoadAttachFileSuccessAction();
  loadDialogMessagesSuccessAction=new LoadDialogMessagesSuccessAction();
  loadDialogMessagesFailAction=new LoadDialogMessagesFailAction();
  typingTimer=new Timer();
  initUI();
  initListeners();
  initActionBar();
  addActions();
  isNeedToScrollMessages=true;
  initLocalBroadcastManagers();
  hideSmileLayout();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  rootView=getLayoutInflater().inflate(layoutResID,null);
  setContentView(rootView);
  resources=getResources();
  imageUtils=new ImageUtils(this);
  loadAttachFileSuccessAction=new LoadAttachFileSuccessAction();
  loadDialogMessagesSuccessAction=new LoadDialogMessagesSuccessAction();
  loadDialogMessagesFailAction=new LoadDialogMessagesFailAction();
  typingTimer=new Timer();
  isNeedToScrollMessages=true;
  initUI();
  initListeners();
  initActionBar();
  addActions();
  initLocalBroadcastManagers();
  hideSmileLayout();
}
Program: 114127
Project: 114127
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (getIntent().hasExtra(QBServiceConsts.EXTRA_ROOM_JID)) {
    dialogId=getIntent().getStringExtra(QBServiceConsts.EXTRA_ROOM_JID);
  }
  dialog=(QBDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  initCursorLoaders();
  startLoadDialogMessages();
  setCurrentDialog(dialog);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (getIntent().hasExtra(QBServiceConsts.EXTRA_ROOM_JID)) {
    dialogId=getIntent().getStringExtra(QBServiceConsts.EXTRA_ROOM_JID);
  }
  dialog=(QBDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  skipMessages=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialog.getDialogId()).getCount();
  initCursorLoaders();
  updateActionBar();
  setCurrentDialog(dialog);
}
Program: 114128
Project: 114128
Buggy source:
@Override protected void onResume(){
  super.onResume();
  updateDialogData();
  if (messagesAdapter != null && !messagesAdapter.isEmpty()) {
    scrollListView();
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
}
Program: 114129
Project: 114129
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  friendOperationAction=new FriendOperationAction();
  opponentFriend=(User)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_OPPONENT);
  dialog=(QBDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  dialogId=dialog.getDialogId();
  friendCursor=UsersDatabaseManager.getFriendCursorById(this,opponentFriend.getUserId());
  initCursorLoaders();
  initActionBar();
  registerContentObservers();
  setCurrentDialog(dialog);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  friendOperationAction=new FriendOperationAction();
  opponentFriend=(User)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_OPPONENT);
  dialog=(QBDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  dialogId=dialog.getDialogId();
  friendCursor=UsersDatabaseManager.getFriendCursorById(this,opponentFriend.getUserId());
  skipMessages=ChatDatabaseManager.getAllDialogMessagesByDialogId(this,dialogId).getCount();
  initCursorLoaders();
  initActionBar();
  registerContentObservers();
  setCurrentDialog(dialog);
}
Program: 114130
Project: 114130
Buggy source:
@Override protected void onResume(){
  super.onResume();
  if (messagesAdapter != null && !messagesAdapter.isEmpty()) {
    scrollListView();
  }
  startLoadDialogMessages();
  currentOpponent=opponentFriend.getFullName();
  checkMessageSendingPossibility();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  currentOpponent=opponentFriend.getFullName();
  checkMessageSendingPossibility();
}
Program: 114131
Project: 114131
Buggy source:
private void initUI(){
  emojisFragment=_findViewById(R.id.emojicons_fragment);
  chatEditText=_findViewById(R.id.message_edittext);
  messagesListView=_findViewById(R.id.messages_listview);
  messageEditText=_findViewById(R.id.message_edittext);
  sendButton=_findViewById(R.id.send_button);
  smilePanelImageButton=_findViewById(R.id.smile_panel_imagebutton);
  sendButton.setEnabled(false);
  messageTextView=_findViewById(R.id.message_textview);
  messageTypingView=_findViewById(R.id.message_typing_view);
  messageTypingBoxImageView=_findViewById(R.id.message_typing_box_imageview);
  messageTypingAnimationDrawable=(AnimationDrawable)messageTypingBoxImageView.getDrawable();
  loadMoreView=_findViewById(R.id.load_more_linearlayout);
  loadMoreView.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void initUI(){
  emojisFragment=_findViewById(R.id.emojicons_fragment);
  chatEditText=_findViewById(R.id.message_edittext);
  messagesListView=_findViewById(R.id.messages_listview);
  messageEditText=_findViewById(R.id.message_edittext);
  sendButton=_findViewById(R.id.send_button);
  smilePanelImageButton=_findViewById(R.id.smile_panel_imagebutton);
  sendButton.setEnabled(false);
  messageTextView=_findViewById(R.id.message_textview);
  messageTypingView=_findViewById(R.id.message_typing_view);
  messageTypingBoxImageView=_findViewById(R.id.message_typing_box_imageview);
  messageTypingAnimationDrawable=(AnimationDrawable)messageTypingBoxImageView.getDrawable();
  loadMoreView=_findViewById(R.id.load_more_linearlayout);
  loadMoreView.setVisibility(View.GONE);
  messagesListView.setOnScrollListener(this);
}
Program: 114132
Project: 114132
Buggy source:
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  firstItemInList=(firstVisibleItem + totalItemCount) == totalItemCount;
  totalItemCountInList=totalItemCount;
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  firstVisiblePosition=firstVisibleItem;
}
Program: 114133
Project: 114133
Buggy source:
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_IDLE) {
    if (firstItemInList && !loadingMore) {
      firstVisiblePositionList=totalItemCountInList - 1;
      loadMoreItems();
    }
  }
}

Fixed version (ground truth):
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_IDLE) {
    if (firstVisiblePosition == 0) {
      loadMoreItems();
    }
  }
}
Program: 114134
Project: 114134
Buggy source:
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  long lastDateLoad=extras.getLong(QBServiceConsts.EXTRA_DATE_LAST_UPDATE_HISTORY);
  int skipMessages=extras.getInt(QBServiceConsts.EXTRA_SKIP_ITEMS);
  Bundle returnedBundle=new Bundle();
  QBRequestGetBuilder customObjectRequestBuilder=new QBRequestGetBuilder();
  customObjectRequestBuilder.setPagesSkip(skipMessages);
  customObjectRequestBuilder.setPagesLimit(ConstsCore.DIALOG_MESSAGES_PER_PAGE);
  List<QBChatMessage> dialogMessagesList=baseChatHelper.getDialogMessages(customObjectRequestBuilder,returnedBundle,dialog,lastDateLoad);
  Bundle bundleResult=new Bundle();
  bundleResult.putSerializable(QBServiceConsts.EXTRA_DIALOG_MESSAGES,(java.io.Serializable)dialogMessagesList);
  bundleResult.putInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES,returnedBundle.getInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES));
  return bundleResult;
}

Fixed version (ground truth):
@Override public Bundle perform(Bundle extras) throws QBResponseException {
  QBDialog dialog=(QBDialog)extras.getSerializable(QBServiceConsts.EXTRA_DIALOG);
  long lastDateLoad=extras.getLong(QBServiceConsts.EXTRA_DATE_LAST_UPDATE_HISTORY);
  int skipMessages=extras.getInt(QBServiceConsts.EXTRA_SKIP_ITEMS);
  Bundle returnedBundle=new Bundle();
  QBRequestGetBuilder customObjectRequestBuilder=new QBRequestGetBuilder();
  customObjectRequestBuilder.setPagesSkip(skipMessages);
  customObjectRequestBuilder.setPagesLimit(ConstsCore.DIALOG_MESSAGES_PER_PAGE);
  customObjectRequestBuilder.sortDesc(QBServiceConsts.EXTRA_DATE_SENT);
  List<QBChatMessage> dialogMessagesList=baseChatHelper.getDialogMessages(customObjectRequestBuilder,returnedBundle,dialog,lastDateLoad);
  Bundle bundleResult=new Bundle();
  bundleResult.putSerializable(QBServiceConsts.EXTRA_DIALOG_MESSAGES,(java.io.Serializable)dialogMessagesList);
  bundleResult.putInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES,returnedBundle.getInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES));
  return bundleResult;
}
Program: 114135
Project: 114135
Buggy source:
public List<QBChatMessage> getDialogMessages(QBRequestGetBuilder customObjectRequestBuilder,Bundle returnedBundle,QBDialog dialog,long lastDateLoad) throws QBResponseException {
  if (lastDateLoad != ConstsCore.ZERO_LONG_VALUE) {
    customObjectRequestBuilder.gt(com.quickblox.chat.Consts.MESSAGE_DATE_SENT,lastDateLoad);
  }
 else {
    deleteMessagesByDialogId(dialog.getDialogId());
  }
  List<QBChatMessage> dialogMessagesList=QBChatService.getDialogMessages(dialog,customObjectRequestBuilder,returnedBundle);
  if (dialogMessagesList != null) {
    ChatDatabaseManager.saveChatMessages(context,dialogMessagesList,dialog.getDialogId());
  }
  return dialogMessagesList;
}

Fixed version (ground truth):
public List<QBChatMessage> getDialogMessages(QBRequestGetBuilder customObjectRequestBuilder,Bundle returnedBundle,QBDialog dialog,long lastDateLoad) throws QBResponseException {
  if (lastDateLoad != ConstsCore.ZERO_LONG_VALUE) {
  }
 else {
    deleteMessagesByDialogId(dialog.getDialogId());
  }
  List<QBChatMessage> dialogMessagesList=QBChatService.getDialogMessages(dialog,customObjectRequestBuilder,returnedBundle);
  if (dialogMessagesList != null) {
    ChatDatabaseManager.saveChatMessages(context,dialogMessagesList,dialog.getDialogId());
  }
  return dialogMessagesList;
}
Program: 114136
Project: 114136
Buggy source:
@Override public void onReceiveNewSession(QBRTCSession session){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (getVideoChatHelperState() != VideoHelperStates.RTC_CLIENT_PROCESS_CALLS) {
    setVideoChatHelperState(VideoHelperStates.RTC_CLIENT_PROCESS_CALLS);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    setCurrentSession(session);
    for (    VideoChatHelperListener listener : videoChatListenersList) {
      listener.onClientReady();
    }
  }
 else {
    sessionManager.addSession(session);
    rejectCall(getCurrentSession().getUserInfo());
  }
}

Fixed version (ground truth):
@Override public void onReceiveNewSession(QBRTCSession session){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (getVideoChatHelperState() != VideoHelperStates.RTC_CLIENT_PROCESS_CALLS) {
    setVideoChatHelperState(VideoHelperStates.RTC_CLIENT_PROCESS_CALLS);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    setCurrentSession(session);
    for (    VideoChatHelperListener listener : videoChatListenersList) {
      listener.onClientReady();
    }
  }
 else {
    sessionManager.addSession(session);
    session.rejectCall(getCurrentSession().getUserInfo());
  }
}
Program: 114137
Project: 114137
Buggy source:
@Override protected void onResume(){
  Log.d("String_Node_Str","String_Node_Str");
  super.onResume();
}

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

Fixed version (ground truth):
@Override protected void onPause(){
  Log.d("String_Node_Str","String_Node_Str");
  super.onPause();
  if (getLocalVideoView() != null) {
    getLocalVideoView().onPause();
  }
  if (getLocalVideoView() != null) {
    getRemoteVideoView().onPause();
  }
}
Program: 114139
Project: 114139
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d("String_Node_Str","String_Node_Str");
  QBRTCClient.getInstance().prepareToProcessCalls(this);
  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();
  parseIntentExtras(getIntent().getExtras());
  addAction(QBServiceConsts.SEND_PUSH_MESSAGES_FAIL_ACTION,failAction);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d("String_Node_Str","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);
}
Program: 114140
Project: 114140
Buggy source:
public void startCall(){
  if (!waitingTasksMap.containsKey(REJECT_CALL_TASK)) {
    Log.d("String_Node_Str","String_Node_Str");
    Runnable callTask=callTasksMap.get(START_CALL_TASK);
    executeCallTask(callTask);
  }
}

Fixed version (ground truth):
public void startCall(){
  if (waitingTasksMap != null && !waitingTasksMap.containsKey(REJECT_CALL_TASK)) {
    Log.d("String_Node_Str","String_Node_Str");
    Runnable callTask=callTasksMap.get(START_CALL_TASK);
    executeCallTask(callTask);
  }
}
Program: 114141
Project: 114141
Buggy source:
@Override public void onStart(){
  Log.d(TAG,"String_Node_Str");
  super.onStart();
  if (!callIsStarted) {
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    QBRTCClient.getInstance().addConnectionCallbacksListener(this);
  }
  Log.d(CALL_INTEGRATION,"String_Node_Str" + getArguments());
  if (getArguments() != null) {
    ConstsCore.CALL_DIRECTION_TYPE directionType=(ConstsCore.CALL_DIRECTION_TYPE)getArguments().getSerializable(ConstsCore.CALL_DIRECTION_TYPE_EXTRA);
    if (directionType == ConstsCore.CALL_DIRECTION_TYPE.OUTGOING && !callIsStarted) {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      ((CallActivity)getActivity()).startCall();
      callIsStarted=true;
    }
  }
}

Fixed version (ground truth):
@Override public void onStart(){
  Log.d(TAG,"String_Node_Str");
  super.onStart();
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  QBRTCClient.getInstance().addConnectionCallbacksListener(this);
}
Program: 114142
Project: 114142
Buggy source:
@Override public void onStop(){
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  super.onStop();
  QBRTCClient.getInstance().removeConnectionCallbacksListener(this);
}
Program: 114143
Project: 114143
Buggy source:
/** 
 * Start call logic
 */
public void startCall(Map<String,String> userInfo,List<Integer> opponents,QBRTCTypes.QBConferenceType qbConferenceType){
  if (getVideoChatHelperState() == VideoHelperStates.WAIT_FOR_CALL) {
    setVideoChatHelperState(VideoHelperStates.RECIVE_INCOME_CALL_MESSAGE);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    if (isClientClosed) {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      setUpCallClient();
    }
    QBRTCSession newSessionWithOpponents=QBRTCClient.getInstance().createNewSessionWithOpponents(opponents,qbConferenceType);
    setCurrentSession(newSessionWithOpponents);
    newSessionWithOpponents.startCall(userInfo);
  }
}

Fixed version (ground truth):
/** 
 * Start call logic
 */
public void startCall(Map<String,String> userInfo,List<Integer> opponents,QBRTCTypes.QBConferenceType qbConferenceType){
  if (getVideoChatHelperState() == VideoHelperStates.WAIT_FOR_CALL) {
    setVideoChatHelperState(VideoHelperStates.RTC_CLIENT_PROCESS_CALLS);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    if (isClientClosed) {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      setUpCallClient();
    }
    QBRTCSession newSessionWithOpponents=QBRTCClient.getInstance().createNewSessionWithOpponents(opponents,qbConferenceType);
    setCurrentSession(newSessionWithOpponents);
    newSessionWithOpponents.startCall(userInfo);
  }
}
Program: 114144
Project: 114144
Buggy source:
@Override public void onReceiveNewSession(QBRTCSession session){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (getVideoChatHelperState() != VideoHelperStates.RTC_CLIENT_PROCESS_CALLS) {
    setVideoChatHelperState(VideoHelperStates.RTC_CLIENT_PROCESS_CALLS);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    setCurrentSession(session);
    for (    VideoChatHelperListener listener : videoChatListenersList) {
      listener.onClientReady();
    }
  }
 else {
    sessionManager.addSession(session);
    session.rejectCall(getCurrentSession().getUserInfo());
  }
}

Fixed version (ground truth):
@Override public void onReceiveNewSession(QBRTCSession session){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (getVideoChatHelperState().ordinal() < VideoHelperStates.RTC_CLIENT_PROCESS_CALLS.ordinal()) {
    setVideoChatHelperState(VideoHelperStates.RTC_CLIENT_PROCESS_CALLS);
    Log.d(CALL_INTEGRATION,"String_Node_Str");
    setCurrentSession(session);
    for (    VideoChatHelperListener listener : videoChatListenersList) {
      listener.onClientReady();
    }
  }
 else {
    sessionManager.addSession(session);
    session.rejectCall(getCurrentSession().getUserInfo());
  }
}
Program: 114145
Project: 114145
Buggy source:
@Override public void onReceiveCallFromUser(Integer integer,QBRTCSessionDescription qbrtcSessionDescription,SessionDescription sessionDescription){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (activityClass != null) {
    if (getVideoChatHelperState() == VideoHelperStates.WAIT_FOR_CALL) {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      setVideoChatHelperState(VideoHelperStates.RECIVE_INCOME_CALL_MESSAGE);
      startCallActivity(qbrtcSessionDescription);
    }
 else {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
    }
  }
 else {
    Log.d(CALL_INTEGRATION,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onReceiveCallFromUser(Integer integer,QBRTCSessionDescription qbrtcSessionDescription,SessionDescription sessionDescription){
  Log.d(CALL_INTEGRATION,"String_Node_Str");
  if (activityClass != null) {
    if (getVideoChatHelperState().ordinal() < VideoHelperStates.RECIVE_INCOME_CALL_MESSAGE.ordinal()) {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
      setVideoChatHelperState(VideoHelperStates.RECIVE_INCOME_CALL_MESSAGE);
      startCallActivity(qbrtcSessionDescription);
    }
 else {
      Log.d(CALL_INTEGRATION,"String_Node_Str");
    }
  }
 else {
    Log.d(CALL_INTEGRATION,"String_Node_Str");
  }
}
Program: 114146
Project: 114146
Buggy source:
private void parseIntentExtras(Bundle extras){
  call_direction_type=(ConstsCore.CALL_DIRECTION_TYPE)extras.getSerializable(ConstsCore.CALL_DIRECTION_TYPE_EXTRA);
  call_type=(QBRTCTypes.QBConferenceType)extras.getSerializable(ConstsCore.CALL_TYPE_EXTRA);
  sessionId=extras.getString("String_Node_Str","String_Node_Str");
  opponent=(User)extras.getSerializable(ConstsCore.EXTRA_FRIEND);
  Log.i(TAG,"String_Node_Str" + opponent);
}

Fixed version (ground truth):
private void parseIntentExtras(Bundle extras){
  call_direction_type=(ConstsCore.CALL_DIRECTION_TYPE)extras.getSerializable(ConstsCore.CALL_DIRECTION_TYPE_EXTRA);
  call_type=(QBRTCTypes.QBConferenceType)extras.getSerializable(ConstsCore.CALL_TYPE_EXTRA);
  sessionId=extras.getString(ConstsCore.SESSION_ID,"String_Node_Str");
  opponent=(User)extras.getSerializable(ConstsCore.EXTRA_FRIEND);
  Log.i(TAG,"String_Node_Str" + opponent);
}
Program: 114147
Project: 114147
Buggy source:
@Override protected void onStart(){
  super.onStart();
  if (videoChatHelper != null) {
    videoChatHelper.setCamState(true);
    videoChatHelper.removeVideoChatHelperListener(this);
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  if (videoChatHelper != null) {
    videoChatHelper.setCamState(true);
    videoChatHelper.addVideoChatHelperListener(this);
  }
}
Program: 114148
Project: 114148
Buggy source:
@Override public void onLocalVideoTrackReceive(final QBRTCVideoTrack videoTrack){
  if (getLocalVideoView() == null) {
    onVideoViewWaitTaskList.add(initLocalVideoTrackTask(videoTrack));
  }
 else {
    initLocalVideoTrack(videoTrack);
  }
}

Fixed version (ground truth):
@Override public void onLocalVideoTrackReceive(final QBRTCVideoTrack videoTrack){
  if (getLocalVideoView() == null) {
    videoTracksSetEnumMap.get(VideoTracks.LOCAL_VIDEO_TRACK).add(initLocalVideoTrackTask(videoTrack));
  }
 else {
    initLocalVideoTrack(videoTrack);
  }
}
Program: 114149
Project: 114149
Buggy source:
@Override public void onRemoteVideoTrackReceive(final QBRTCVideoTrack videoTrack,Integer userID){
  if (getRemoteVideoView() == null) {
    onVideoViewWaitTaskList.add(initRemoteVideoTrackTask(videoTrack));
  }
 else {
    initRemoteVideoTrack(videoTrack);
  }
}

Fixed version (ground truth):
@Override public void onRemoteVideoTrackReceive(final QBRTCVideoTrack videoTrack,Integer userID){
  if (getRemoteVideoView() == null) {
    videoTracksSetEnumMap.get(VideoTracks.REMOTE_VIDEO_TRACK).add(initRemoteVideoTrackTask(videoTrack));
  }
 else {
    initRemoteVideoTrack(videoTrack);
  }
}
Program: 114150
Project: 114150
Buggy source:
private Runnable initSwitchSpeakerTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d("String_Node_Str","String_Node_Str");
      boolean result=videoChatHelper.switchMic();
    }
  }
;
}

Fixed version (ground truth):
private Runnable initSwitchSpeakerTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d("String_Node_Str","String_Node_Str");
      videoChatHelper.switchMic();
    }
  }
;
}
Program: 114151
Project: 114151
Buggy source:
public void setLocalVideoView(QBGLVideoView videoView){
  this.localVideoView=videoView;
  onVideoViewCreated();
}

Fixed version (ground truth):
public void setLocalVideoView(QBGLVideoView videoView){
  this.localVideoView=videoView;
  onLocalVideoViewCreated();
}
Program: 114152
Project: 114152
Buggy source:
public void startIncomeCallTimer(){
  Log.d("String_Node_Str","String_Node_Str");
  if (singleTheadScheduledExecutor == null) {
    initIncommingCallTask();
  }
  closeIncomeCallFutureTask=singleTheadScheduledExecutor.schedule(closeIncomeCallTimerTask,QBRTCConfig.getAnswerTimeInterval(),TimeUnit.SECONDS);
}

Fixed version (ground truth):
public void startIncomeCallTimer(){
  Log.d("String_Node_Str","String_Node_Str");
  if (singleTheadScheduledExecutor == null) {
    initIncomingCallTask();
  }
  closeIncomeCallFutureTask=singleTheadScheduledExecutor.schedule(closeIncomeCallTimerTask,QBRTCConfig.getAnswerTimeInterval(),TimeUnit.SECONDS);
}
Program: 114153
Project: 114153
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d("String_Node_Str","String_Node_Str");
  QBRTCClient.getInstance().prepareToProcessCalls(this);
  canPerformLogout.set(false);
  setContentView(R.layout.activity_main_call);
  actionBar.hide();
  mediaPlayer=App.getInstance().getMediaPlayer();
  callTasksHandler=new Handler();
  callTasksQueue=new LinkedList<>();
  onVideoViewWaitTaskList=new LinkedList<>();
  waitingTasksMap=new TreeMap<>();
  parseIntentExtras(getIntent().getExtras());
  initCallTasksMap();
  addAction(QBServiceConsts.SEND_PUSH_MESSAGES_FAIL_ACTION,failAction);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Log.d("String_Node_Str","String_Node_Str");
  QBRTCClient.getInstance().prepareToProcessCalls(this);
  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();
  parseIntentExtras(getIntent().getExtras());
  addAction(QBServiceConsts.SEND_PUSH_MESSAGES_FAIL_ACTION,failAction);
}
Program: 114154
Project: 114154
Buggy source:
@Override protected void onDestroy(){
  Log.d("String_Node_Str","String_Node_Str");
  cancelPlayer();
  super.onDestroy();
  if (QBRTCClient.isInitiated()) {
    QBRTCClient.getInstance().close(true);
  }
  if (videoChatHelper != null) {
    videoChatHelper.removeVideoChatHelperListener(this);
    videoChatHelper.disposeAllResources();
    videoChatHelper.setClientClosed();
  }
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  Log.d("String_Node_Str","String_Node_Str");
  cancelPlayer();
  super.onDestroy();
  if (QBRTCClient.isInitiated()) {
    QBRTCClient.getInstance().close(true);
  }
  if (videoChatHelper != null) {
    videoChatHelper.setClientClosed();
  }
}
Program: 114155
Project: 114155
Buggy source:
private Runnable initRejectCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d("String_Node_Str","String_Node_Str");
      cancelPlayer();
      videoChatHelper.rejectCall(userInfo);
      finish();
    }
  }
;
}

Fixed version (ground truth):
private Runnable initRejectCallTask(){
  return new Runnable(){
    @Override public void run(){
      Log.d("String_Node_Str","String_Node_Str");
      cancelPlayer();
      videoChatHelper.rejectCall(userInfo);
    }
  }
;
}
Program: 114156
Project: 114156
Buggy source:
public void setRemoteVideoView(QBGLVideoView videoView){
  this.remoteVideoView=videoView;
  onVideoViewCreated();
}

Fixed version (ground truth):
public void setRemoteVideoView(QBGLVideoView videoView){
  this.remoteVideoView=videoView;
  onRemoteVideoViewCreated();
}
Program: 114157
Project: 114157
Buggy source:
private Runnable initStartCallTask(){
  final List<Integer> opponents=new ArrayList<>();
  opponents.add(opponent.getUserId());
  return new Runnable(){
    @Override public void run(){
      Log.d("String_Node_Str","String_Node_Str");
      videoChatHelper.startCall(userInfo,opponents,call_type);
    }
  }
;
}

Fixed version (ground truth):
private Runnable initStartCallTask(){
  return new Runnable(){
    @Override public void run(){
      final List<Integer> opponents=new ArrayList<>();
      opponents.add(opponent.getUserId());
      Log.d("String_Node_Str","String_Node_Str");
      videoChatHelper.startCall(userInfo,opponents,call_type);
    }
  }
;
}
Program: 114158
Project: 114158
Buggy source:
@Override public void onClick(View v){
  ((CallActivity)getActivity()).stopIncomeCallTimer();
switch (v.getId()) {
case R.id.acceptCallButton:
    Log.d(TAG,"String_Node_Str");
  accept();
break;
case R.id.denyCallButton:
Log.d(TAG,"String_Node_Str");
reject();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.acceptCallButton:
    Log.d(TAG,"String_Node_Str");
  accept();
break;
case R.id.denyCallButton:
Log.d(TAG,"String_Node_Str");
((CallActivity)getActivity()).stopIncomeCallTimer();
reject();
break;
default :
break;
}
}
Program: 114159
Project: 114159
Buggy source:
protected void showContactRequestNotification(Bundle extras){
  int senderUserId=extras.getInt(QBServiceConsts.EXTRA_USER_ID);
  senderUser=UsersDatabaseManager.getUserById(activity,senderUserId);
  String message=extras.getString(QBServiceConsts.EXTRA_MESSAGE);
  String dialogId=ChatDatabaseManager.getPrivateDialogIdByOpponentId(activity,senderUserId);
  isPrivateMessage=true;
  if (isMessagesDialogCorrect(dialogId)) {
    showNewMessageAlert(senderUser,message);
  }
}

Fixed version (ground truth):
protected void showContactRequestNotification(Bundle extras){
  int senderUserId=extras.getInt(QBServiceConsts.EXTRA_USER_ID);
  senderUser=DatabaseManager.getInstance().getUserManager().get(senderUserId);
  String message=extras.getString(QBServiceConsts.EXTRA_MESSAGE);
  String dialogId=ChatDatabaseManager.getPrivateDialogIdByOpponentId(activity,senderUserId);
  isPrivateMessage=true;
  if (isMessagesDialogCorrect(dialogId)) {
    showNewMessageAlert(senderUser,message);
  }
}
Program: 114161
Project: 114161
Buggy source:
@Override protected void onFileSelected(Uri originalUri){
  Bitmap bitmap=imageUtils.getBitmap(originalUri);
  new ReceiveFileFromBitmapTask(PrivateDialogActivity.this).execute(imageUtils,bitmap,true);
}

Fixed version (ground truth):
@Override protected void onFileSelected(Bitmap bitmap){
  new ReceiveFileFromBitmapTask(PrivateDialogActivity.this).execute(imageUtils,bitmap,true);
}
Program: 114162
Project: 114162
Buggy source:
private void showRejectUserDialog(final int userId){
  User user=UsersDatabaseManager.getUserById(this,userId);
  AlertDialog alertDialog=AlertDialog.newInstance(getResources().getString(R.string.frl_dlg_reject_friend,user.getFullName()));
  alertDialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      showProgress();
      QBRejectFriendCommand.start(PrivateDialogActivity.this,userId);
    }
  }
);
  alertDialog.setNegativeButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  alertDialog.show(getFragmentManager(),null);
}

Fixed version (ground truth):
private void showRejectUserDialog(final int userId){
  User user=DatabaseManager.getInstance().getUserManager().get(userId);
  AlertDialog alertDialog=AlertDialog.newInstance(getResources().getString(R.string.frl_dlg_reject_friend,user.getFullName()));
  alertDialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      showProgress();
      QBRejectFriendCommand.start(PrivateDialogActivity.this,userId);
    }
  }
);
  alertDialog.setNegativeButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  alertDialog.show(getFragmentManager(),null);
}
Program: 114163
Project: 114163
Buggy source:
private void checkMessageSendingPossibility(){
  boolean isFriend=UsersDatabaseManager.isFriendInBase(PrivateDialogActivity.this,opponentFriend.getUserId());
  messageEditText.setEnabled(isFriend);
  smilePanelImageButton.setEnabled(isFriend);
}

Fixed version (ground truth):
private void checkMessageSendingPossibility(){
  boolean isFriend=DatabaseManager.getInstance().getFriendManager().getByUserId(opponentFriend.getUserId()) != null;
  messageEditText.setEnabled(isFriend);
  smilePanelImageButton.setEnabled(isFriend);
}
Program: 114164
Project: 114164
Buggy source:
private void initActionBar(){
  actionBar.setTitle(opponentFriend.getFullName());
  actionBar.setLogo(R.drawable.placeholder_user);
  if (!TextUtils.isEmpty(opponentFriend.getAvatar())) {
    loadLogoActionBar(opponentFriend.getAvatar());
  }
}

Fixed version (ground truth):
private void initActionBar(){
  actionBar.setTitle(opponentFriend.getFullName());
  actionBar.setSubtitle(OnlineStatusHelper.getOnlineStatus(opponentFriend.isOnline()));
  actionBar.setLogo(R.drawable.placeholder_user);
  if (!TextUtils.isEmpty(opponentFriend.getAvatar())) {
    loadLogoActionBar(opponentFriend.getAvatar());
  }
}