nus-yam/ex-repair huggingface dataset:
Program: 113987
Project: 113987
Buggy source:
@Override protected void updateMessagesList(){
  int oldMessagesCount=messagesAdapter.getAllItems().size();
  this.combinationMessagesList=createCombinationMessagesList();
  processCombinationMessages();
  messagesAdapter.setList(combinationMessagesList);
  checkForScrolling(oldMessagesCount);
}

Fixed version (ground truth):
@Override protected void updateMessagesList(){
  final int oldMessagesCount=messagesAdapter.getAllItems().size();
  (new BaseAsyncTask<Void,Void,Boolean>(){
    @Override public Boolean performInBackground(    Void... params) throws Exception {
      combinationMessagesList=createCombinationMessagesList();
      processCombinationMessages();
      return true;
    }
    @Override public void onResult(    Boolean aBoolean){
      messagesAdapter.setList(combinationMessagesList);
      checkForScrolling(oldMessagesCount);
    }
    @Override public void onException(    Exception e){
      ErrorUtils.showError(GroupDialogActivity.this,e);
    }
  }
).execute();
}
Program: 113988
Project: 113988
Buggy source:
private void initCrashlytics(){
  Crashlytics crashlyticsKit=new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
  Fabric.with(this,crashlyticsKit);
}

Fixed version (ground truth):
private void initCrashlytics(){
  Crashlytics crashlyticsKit=new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
  TwitterAuthConfig authConfig=new TwitterAuthConfig(StringObfuscator.getTwitterConsumerKey(),StringObfuscator.getTwitterConsumerSecret());
  Fabric.with(this,crashlyticsKit,new TwitterCore(authConfig),new Digits.Builder().withTheme(R.style.AppTheme).build());
}
Program: 113989
Project: 113989
Buggy source:
private void initFields(Bundle savedInstanceState){
  resources=getResources();
  if (savedInstanceState != null && savedInstanceState.containsKey(STARTED_LOGIN_TYPE)) {
    loginType=(LoginType)savedInstanceState.getSerializable(STARTED_LOGIN_TYPE);
  }
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper(this);
  twitterDigitsAuthCallback=new TwitterDigitsAuthCallback();
  loginSuccessAction=new LoginSuccessAction();
  socialLoginSuccessAction=new SocialLoginSuccessAction();
  failAction=new FailAction();
}

Fixed version (ground truth):
private void initFields(Bundle savedInstanceState){
  resources=getResources();
  if (savedInstanceState != null && savedInstanceState.containsKey(STARTED_LOGIN_TYPE)) {
    loginType=(LoginType)savedInstanceState.getSerializable(STARTED_LOGIN_TYPE);
  }
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper();
  twitterDigitsAuthCallback=new TwitterDigitsAuthCallback();
  loginSuccessAction=new LoginSuccessAction();
  socialLoginSuccessAction=new SocialLoginSuccessAction();
  failAction=new FailAction();
}
Program: 113990
Project: 113990
Buggy source:
private QBUser createUserForUpdating(){
  QBUser newUser=new QBUser();
  newUser.setId(qbUser.getId());
  newUser.setPassword(qbUser.getPassword());
  newUser.setOldPassword(qbUser.getOldPassword());
  qbUser.setFullName(currentFullName);
  newUser.setFullName(currentFullName);
  newUser.setCustomData(Utils.customDataToString(userCustomData));
  return newUser;
}

Fixed version (ground truth):
private QBUser createUserForUpdating(){
  QBUser newUser=new QBUser();
  newUser.setId(qbUser.getId());
  newUser.setPassword(qbUser.getPassword());
  newUser.setOldPassword(qbUser.getOldPassword());
  qbUser.setFullName(currentFullName);
  newUser.setFullName(currentFullName);
  newUser.setFacebookId(qbUser.getFacebookId());
  newUser.setTwitterId(qbUser.getTwitterId());
  newUser.setTwitterDigitsId(qbUser.getTwitterDigitsId());
  newUser.setCustomData(Utils.customDataToString(userCustomData));
  return newUser;
}
Program: 113991
Project: 113991
Buggy source:
private void initFields(){
  title=getString(R.string.settings_title);
  user=UserFriendUtils.createLocalUser(AppSession.getSession().getUser());
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper(this);
}

Fixed version (ground truth):
private void initFields(){
  title=getString(R.string.settings_title);
  user=UserFriendUtils.createLocalUser(AppSession.getSession().getUser());
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper();
}
Program: 113992
Project: 113992
Buggy source:
public TwitterDigitsHelper(Context context){
  this.context=context;
  initTwitterDigits();
}

Fixed version (ground truth):
public TwitterDigitsHelper(){
}
Program: 113993
Project: 113993
Buggy source:
public static AppSession load(){
  String loginTypeRaw=CoreSharedHelper.getInstance().getLoginType();
  String qbToken=CoreSharedHelper.getInstance().getQBToken();
  int userId=CoreSharedHelper.getInstance().getUserId();
  String userFullName=CoreSharedHelper.getInstance().getUserFullName();
  QBUser qbUser=new QBUser();
  qbUser.setId(userId);
  qbUser.setEmail(CoreSharedHelper.getInstance().getUserEmail());
  qbUser.setPassword(CoreSharedHelper.getInstance().getUserPassword());
  qbUser.setFullName(userFullName);
  LoginType loginType=LoginType.valueOf(loginTypeRaw);
  return new AppSession(loginType,qbUser,qbToken);
}

Fixed version (ground truth):
public static AppSession load(){
  String loginTypeRaw=CoreSharedHelper.getInstance().getLoginType();
  String qbToken=CoreSharedHelper.getInstance().getQBToken();
  int userId=CoreSharedHelper.getInstance().getUserId();
  String userFullName=CoreSharedHelper.getInstance().getUserFullName();
  QBUser qbUser=new QBUser();
  qbUser.setId(userId);
  qbUser.setEmail(CoreSharedHelper.getInstance().getUserEmail());
  qbUser.setPassword(CoreSharedHelper.getInstance().getUserPassword());
  qbUser.setFullName(userFullName);
  qbUser.setFacebookId(CoreSharedHelper.getInstance().getFBId());
  qbUser.setTwitterId(CoreSharedHelper.getInstance().getTwitterId());
  qbUser.setTwitterDigitsId(CoreSharedHelper.getInstance().getTwitterDigitsId());
  LoginType loginType=LoginType.valueOf(loginTypeRaw);
  return new AppSession(loginType,qbUser,qbToken);
}
Program: 113994
Project: 113994
Buggy source:
private void saveUser(QBUser user){
  coreSharedHelper.saveUserId(user.getId());
  coreSharedHelper.saveUserEmail(user.getEmail());
  coreSharedHelper.saveUserPassword(user.getPassword());
  coreSharedHelper.saveUserFullName(user.getFullName());
}

Fixed version (ground truth):
private void saveUser(QBUser user){
  coreSharedHelper.saveUserId(user.getId());
  coreSharedHelper.saveUserEmail(user.getEmail());
  coreSharedHelper.saveUserPassword(user.getPassword());
  coreSharedHelper.saveUserFullName(user.getFullName());
  coreSharedHelper.saveFBId(user.getFacebookId());
  coreSharedHelper.saveTwitterId(user.getTwitterId());
  coreSharedHelper.saveTwitterDigitsId(user.getTwitterDigitsId());
}
Program: 113995
Project: 113995
Buggy source:
@Override protected Bundle perform(Bundle extras) throws Exception {
  QBUser user=(QBUser)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  File file=(File)extras.getSerializable(QBServiceConsts.EXTRA_FILE);
  int authorizationType=extras.getInt(QBServiceConsts.AUTH_ACTION_TYPE,ConstsCore.NOT_INITIALIZED_VALUE);
  Bundle result=new Bundle();
  if (isLoggedViaSocial(user,authorizationType)) {
    result.putSerializable(QBServiceConsts.EXTRA_USER,user);
    return result;
  }
  QBUser newUser=updateUser(user,file);
  result.putSerializable(QBServiceConsts.EXTRA_USER,newUser);
  return result;
}

Fixed version (ground truth):
@Override protected Bundle perform(Bundle extras) throws Exception {
  QBUser user=(QBUser)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  File file=(File)extras.getSerializable(QBServiceConsts.EXTRA_FILE);
  Bundle result=new Bundle();
  QBUser newUser=updateUser(user,file);
  result.putSerializable(QBServiceConsts.EXTRA_USER,newUser);
  return result;
}
Program: 113996
Project: 113996
Buggy source:
public void clearUserData(){
  saveUserId(0);
  saveUserEmail(null);
  saveUserPassword(null);
  saveUserFullName(null);
}

Fixed version (ground truth):
public void clearUserData(){
  saveUserId(0);
  saveUserEmail(null);
  saveUserPassword(null);
  saveUserFullName(null);
  saveFBId(null);
  saveTwitterId(null);
  saveTwitterDigitsId(null);
}
Program: 113997
Project: 113997
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  initCrashlytics();
  initApplication();
  registerActivityLifecycleCallbacks(new ActivityLifecycleHandler());
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  initFabric();
  initApplication();
  registerActivityLifecycleCallbacks(new ActivityLifecycleHandler());
}
Program: 113998
Project: 113998
Buggy source:
private void initFields(Bundle savedInstanceState){
  resources=getResources();
  if (savedInstanceState != null && savedInstanceState.containsKey(STARTED_LOGIN_TYPE)) {
    loginType=(LoginType)savedInstanceState.getSerializable(STARTED_LOGIN_TYPE);
  }
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper(this);
  twitterDigitsAuthCallback=new TwitterDigitsAuthCallback();
  loginSuccessAction=new LoginSuccessAction();
  socialLoginSuccessAction=new SocialLoginSuccessAction();
  failAction=new FailAction();
}

Fixed version (ground truth):
private void initFields(Bundle savedInstanceState){
  resources=getResources();
  if (savedInstanceState != null && savedInstanceState.containsKey(STARTED_LOGIN_TYPE)) {
    loginType=(LoginType)savedInstanceState.getSerializable(STARTED_LOGIN_TYPE);
  }
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper();
  twitterDigitsAuthCallback=new TwitterDigitsAuthCallback();
  loginSuccessAction=new LoginSuccessAction();
  socialLoginSuccessAction=new SocialLoginSuccessAction();
  failAction=new FailAction();
}
Program: 113999
Project: 113999
Buggy source:
private void initFields(){
  title=getString(R.string.settings_title);
  user=UserFriendUtils.createLocalUser(AppSession.getSession().getUser());
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper(this);
}

Fixed version (ground truth):
private void initFields(){
  title=getString(R.string.settings_title);
  user=UserFriendUtils.createLocalUser(AppSession.getSession().getUser());
  facebookHelper=new FacebookHelper(this);
  twitterDigitsHelper=new TwitterDigitsHelper();
}
Program: 114000
Project: 114000
Buggy source:
public TwitterDigitsHelper(Context context){
  this.context=context;
  initTwitterDigits();
}

Fixed version (ground truth):
public TwitterDigitsHelper(){
}
Program: 114001
Project: 114001
Buggy source:
private void checkPermissions(){
  String[] permissionList=new String[2];
  permissionList[0]=Manifest.permission.RECORD_AUDIO;
  if (QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO.equals(qbConferenceType)) {
    permissionList[1]=(Manifest.permission.CAMERA);
  }
  if (systemPermissionHelper.isAllPermissionGranted(permissionList)) {
    initCallFragment();
  }
 else {
    ActivityCompat.requestPermissions(this,permissionList,SystemPermissionHelper.PERMISSIONS_REQUEST);
  }
}

Fixed version (ground truth):
private void checkPermissions(){
  String[] permissionList=new String[2];
  permissionList[0]=Manifest.permission.RECORD_AUDIO;
  if (QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO.equals(qbConferenceType)) {
    permissionList[1]=(Manifest.permission.CAMERA);
  }
  if (systemPermissionHelper.isAllPermissionGranted(permissionList)) {
    initCallFragment();
  }
 else {
    systemPermissionHelper.checkAndRequestPermissions(permissionList);
  }
}
Program: 114002
Project: 114002
Buggy source:
private String[] collectDaniedPermissions(String... permissions){
  String[] daniedPermissions=new String[permissions.length];
  for (  String permission : permissions) {
    if (isPermissionDanied(permission)) {
      daniedPermissions[daniedPermissions.length - 1]=permission;
    }
  }
  return daniedPermissions;
}

Fixed version (ground truth):
private String[] collectDaniedPermissions(String... permissions){
  ArrayList<String> daniedPermissionsList=new ArrayList<>();
  for (  String permission : permissions) {
    if (isPermissionDanied(permission)) {
      daniedPermissionsList.add(permission);
    }
  }
  return daniedPermissionsList.toArray(new String[daniedPermissionsList.size()]);
}
Program: 114003
Project: 114003
Buggy source:
@Override public void onSessionClosed(final QBRTCSession session){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(TAG,"String_Node_Str" + session.getSessionID() + "String_Node_Str");
      if (session.equals(getCurrentSession())) {
        Fragment currentFragment=getCurrentFragment();
        if (isInComingCall) {
          stopIncomeCallTimer();
          if (currentFragment instanceof IncomingCallFragment) {
            removeFragment();
            finish();
          }
        }
        Log.d(TAG,"String_Node_Str");
        if (qbCallChatHelper != null) {
          qbCallChatHelper.releaseCurrentSession(CallActivity.this,CallActivity.this);
        }
        stopTimer();
        closeByWifiStateAllow=true;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onSessionClosed(final QBRTCSession session){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(TAG,"String_Node_Str" + session.getSessionID() + "String_Node_Str");
      if (session.equals(getCurrentSession())) {
        Fragment currentFragment=getCurrentFragment();
        if (isInComingCall) {
          stopIncomeCallTimer();
          if (currentFragment instanceof IncomingCallFragment) {
            removeFragment();
            finish();
          }
        }
        Log.d(TAG,"String_Node_Str");
        if (qbCallChatHelper != null) {
          qbCallChatHelper.releaseCurrentSession(CallActivity.this,CallActivity.this);
        }
        stopTimer();
        closeByWifiStateAllow=true;
        finish();
      }
    }
  }
);
}
Program: 114004
Project: 114004
Buggy source:
public void parseChatMessage(Bundle extras){
  if (extras.getString(ChatNotificationHelper.MESSAGE) != null) {
    message=extras.getString(ChatNotificationHelper.MESSAGE);
  }
  if (extras.getString(ChatNotificationHelper.USER_ID) != null) {
    userId=Integer.parseInt(extras.getString(ChatNotificationHelper.USER_ID));
  }
  if (extras.getString(ChatNotificationHelper.DIALOG_ID) != null) {
    dialogId=extras.getString(ChatNotificationHelper.DIALOG_ID);
  }
  if (SystemUtils.isAppRunningNow()) {
    return;
  }
  boolean chatPush=userId != 0 && !TextUtils.isEmpty(dialogId);
  if (chatPush) {
    saveOpeningDialogData(userId,dialogId);
    if (AppSession.getSession().getUser() != null && !isLoginNow) {
      isLoginNow=true;
      LoginHelper loginHelper=new LoginHelper(context);
      loginHelper.makeGeneralLogin(new GlobalLoginListener());
      return;
    }
  }
  saveOpeningDialog(false);
}

Fixed version (ground truth):
public void parseChatMessage(Bundle extras){
  if (extras.getString(ChatNotificationHelper.MESSAGE) != null) {
    message=extras.getString(ChatNotificationHelper.MESSAGE);
  }
  if (extras.getString(ChatNotificationHelper.USER_ID) != null) {
    userId=Integer.parseInt(extras.getString(ChatNotificationHelper.USER_ID));
  }
  if (extras.getString(ChatNotificationHelper.DIALOG_ID) != null) {
    dialogId=extras.getString(ChatNotificationHelper.DIALOG_ID);
  }
  if (SystemUtils.isAppRunningNow()) {
    return;
  }
  boolean chatPush=userId != 0 && !TextUtils.isEmpty(dialogId);
  if (chatPush) {
    saveOpeningDialogData(userId,dialogId);
    if (AppSession.getSession().getUser() != null && !isLoginNow) {
      isLoginNow=true;
      LoginHelper loginHelper=new LoginHelper(context);
      loginHelper.makeGeneralLogin(new GlobalLoginListener());
      return;
    }
  }
 else {
    sendNotification(message);
  }
  saveOpeningDialog(false);
}
Program: 114005
Project: 114005
Buggy source:
@Override public Bundle perform(Bundle extras) throws Exception {
  String socialProvider=(String)extras.getSerializable(QBServiceConsts.EXTRA_SOCIAL_PROVIDER);
  String accessToken=(String)extras.getSerializable(QBServiceConsts.EXTRA_ACCESS_TOKEN);
  String accessTokenSecret=(String)extras.getSerializable(QBServiceConsts.EXTRA_ACCESS_TOKEN_SECRET);
  QBUser user=authHelper.login(socialProvider,accessToken,accessTokenSecret);
  if (user.getCustomData() == null) {
    CoreSharedHelper.getInstance().saveUsersImportInitialized(false);
    extras.putSerializable(QBServiceConsts.AUTH_ACTION_TYPE,QBServiceConsts.AUTH_TYPE_REGISTRATION);
    extras.putSerializable(QBServiceConsts.EXTRA_USER,getUserWithAvatar(user));
  }
 else {
    CoreSharedHelper.getInstance().saveUsersImportInitialized(true);
    extras.putSerializable(QBServiceConsts.AUTH_ACTION_TYPE,QBServiceConsts.AUTH_TYPE_LOGIN);
    extras.putSerializable(QBServiceConsts.EXTRA_USER,user);
  }
  return extras;
}

Fixed version (ground truth):
@Override public Bundle perform(Bundle extras) throws Exception {
  String socialProvider=(String)extras.getSerializable(QBServiceConsts.EXTRA_SOCIAL_PROVIDER);
  String accessToken=(String)extras.getSerializable(QBServiceConsts.EXTRA_ACCESS_TOKEN);
  String accessTokenSecret=(String)extras.getSerializable(QBServiceConsts.EXTRA_ACCESS_TOKEN_SECRET);
  QBUser user=authHelper.login(socialProvider,accessToken,accessTokenSecret);
  UserCustomData userCustomData=Utils.customDataToObject(user.getCustomData());
  if (TextUtils.isEmpty(userCustomData.getAvatar_url())) {
    CoreSharedHelper.getInstance().saveUsersImportInitialized(false);
    extras.putSerializable(QBServiceConsts.AUTH_ACTION_TYPE,QBServiceConsts.AUTH_TYPE_REGISTRATION);
    extras.putSerializable(QBServiceConsts.EXTRA_USER,getUserWithAvatar(user));
  }
 else {
    CoreSharedHelper.getInstance().saveUsersImportInitialized(true);
    extras.putSerializable(QBServiceConsts.AUTH_ACTION_TYPE,QBServiceConsts.AUTH_TYPE_LOGIN);
    extras.putSerializable(QBServiceConsts.EXTRA_USER,user);
  }
  return extras;
}
Program: 114006
Project: 114006
Buggy source:
private QBUser getUserWithAvatar(QBUser user){
  String avatarUrl=context.getString(R.string.url_to_facebook_avatar,user.getFacebookId());
  QBUser newUser=new QBUser();
  newUser.setId(user.getId());
  newUser.setPassword(user.getPassword());
  newUser.setCustomData(Utils.customDataToString(getUserCustomData(avatarUrl)));
  return newUser;
}

Fixed version (ground truth):
private QBUser getUserWithAvatar(QBUser user){
  String avatarUrl=context.getString(R.string.url_to_facebook_avatar,user.getFacebookId());
  user.setCustomData(Utils.customDataToString(getUserCustomData(avatarUrl)));
  return user;
}
Program: 114007
Project: 114007
Buggy source:
private void closeChatLocally(){
  if (baseChatHelper != null) {
    baseChatHelper.closeChat(ChatUtils.createQBDialogFromLocalDialog(dataManager,dialog),generateBundleToInitDialog());
  }
  dialog=null;
}

Fixed version (ground truth):
private void closeChatLocally(){
  if (baseChatHelper != null && dialog != null) {
    baseChatHelper.closeChat(ChatUtils.createQBDialogFromLocalDialog(dataManager,dialog),generateBundleToInitDialog());
  }
  dialog=null;
}
Program: 114008
Project: 114008
Buggy source:
private void initFields(){
  chatHelperIdentifier=QBService.GROUP_CHAT_HELPER;
  dialog=(Dialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  combinationMessagesList=createCombinationMessagesList();
  title=dialog.getTitle();
}

Fixed version (ground truth):
private void initFields(){
  chatHelperIdentifier=QBService.GROUP_CHAT_HELPER;
  dialog=(Dialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  combinationMessagesList=createCombinationMessagesList();
  if (dialog != null)   title=dialog.getTitle();
}
Program: 114009
Project: 114009
Buggy source:
@Override protected void updateActionBar(){
  if (isNetworkAvailable()) {
    setActionBarTitle(dialog.getTitle());
    checkActionBarLogo(dialog.getPhoto(),R.drawable.placeholder_group);
  }
}

Fixed version (ground truth):
@Override protected void updateActionBar(){
  if (isNetworkAvailable() && dialog != null) {
    setActionBarTitle(dialog.getTitle());
    checkActionBarLogo(dialog.getPhoto(),R.drawable.placeholder_group);
  }
}
Program: 114010
Project: 114010
Buggy source:
private void checkImportFriends(){
  if (!appSharedHelper.isUsersImportInitialized()) {
    showProgress();
    importFriendsHelper=new ImportFriendsHelper(MainActivity.this,facebookHelper);
  }
}

Fixed version (ground truth):
private void checkImportFriends(){
  Log.d("String_Node_Str","String_Node_Str");
  if (!appSharedHelper.isUsersImportInitialized()) {
    showProgress();
    importFriendsHelper=new ImportFriendsHelper(MainActivity.this,facebookHelper);
  }
}
Program: 114011
Project: 114011
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (facebookHelper != null && resultCode != Activity.RESULT_CANCELED) {
    facebookHelper.onActivityResult(requestCode,resultCode,data);
  }
 else {
    FacebookHelper.logout();
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (facebookHelper != null) {
    facebookHelper.onActivityResult(requestCode,resultCode,data);
  }
 else {
  }
}
Program: 114012
Project: 114012
Buggy source:
@Override public void call(Session session,SessionState state,Exception exception){
  if (session.isOpened()) {
    importFriendsHelper.startGetFriendsListTask(true);
  }
 else   if (!session.isClosed() && !appSharedHelper.isUsersImportInitialized()) {
    importFriendsHelper.startGetFriendsListTask(false);
    hideProgress();
  }
}

Fixed version (ground truth):
@Override public void call(Session session,SessionState state,Exception exception){
  if (session.isOpened()) {
    importFriendsHelper.startGetFriendsListTask(true);
  }
 else   if (!session.isClosed() && !appSharedHelper.isUsersImportInitialized()) {
    importFriendsHelper.startGetFriendsListTask(false);
    appSharedHelper.saveUsersImportInitialized(true);
    hideProgress();
  }
}
Program: 114013
Project: 114013
Buggy source:
@OnItemClick(R.id.chats_listview) void startChat(int position){
  Dialog dialog=dialogsListAdapter.getItem(position);
  if (dialog.getType() == Dialog.Type.PRIVATE) {
    startPrivateChatActivity(dialog);
  }
 else {
    startGroupChatActivity(dialog);
  }
}

Fixed version (ground truth):
@OnItemClick(R.id.chats_listview) void startChat(int position){
  Dialog dialog=dialogsListAdapter.getItem(position);
  if (!baseActivity.checkNetworkAvailableWithError() && isFirstOpeningDialog(dialog.getDialogId())) {
    return;
  }
  if (dialog.getType() == Dialog.Type.PRIVATE) {
    startPrivateChatActivity(dialog);
  }
 else {
    startGroupChatActivity(dialog);
  }
}
Program: 114014
Project: 114014
Buggy source:
private void startPrivateChatActivity(Dialog dialog){
  List<DialogOccupant> occupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(dialog.getDialogId());
  User occupant=ChatUtils.getOpponentFromPrivateDialog(UserFriendUtils.createLocalUser(qbUser),occupantsList);
  boolean isFirstOpenDialog=!dataManager.getMessageDataManager().getTempMessagesByDialogId(dialog.getDialogId()).isEmpty();
  if (!TextUtils.isEmpty(dialog.getDialogId())) {
    if (!baseActivity.checkNetworkAvailableWithError() && isFirstOpenDialog) {
      return;
    }
    PrivateDialogActivity.start(baseActivity,occupant,dialog);
  }
}

Fixed version (ground truth):
private void startPrivateChatActivity(Dialog dialog){
  List<DialogOccupant> occupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(dialog.getDialogId());
  User opponent=ChatUtils.getOpponentFromPrivateDialog(UserFriendUtils.createLocalUser(qbUser),occupantsList);
  if (!TextUtils.isEmpty(dialog.getDialogId())) {
    PrivateDialogActivity.start(baseActivity,opponent,dialog);
  }
}
Program: 114015
Project: 114015
Buggy source:
private void rejectUser(final int userId){
  showRejectUserDialog(userId);
}

Fixed version (ground truth):
private void rejectUser(final int userId){
  if (isNetworkAvailable()) {
    if (!isChatInitializedAndUserLoggedIn()) {
      ToastUtils.longToast(R.string.call_chat_service_is_initializing);
      return;
    }
    showRejectUserDialog(userId);
  }
 else {
    ToastUtils.longToast(R.string.dlg_fail_connection);
    return;
  }
}
Program: 114016
Project: 114016
Buggy source:
private void acceptUser(final int userId){
  showProgress();
  QBAcceptFriendCommand.start(this,userId);
}

Fixed version (ground truth):
private void acceptUser(final int userId){
  if (isNetworkAvailable()) {
    if (!isChatInitializedAndUserLoggedIn()) {
      ToastUtils.longToast(R.string.call_chat_service_is_initializing);
      return;
    }
    showProgress();
    QBAcceptFriendCommand.start(this,userId);
  }
 else {
    ToastUtils.longToast(R.string.dlg_fail_connection);
    return;
  }
}
Program: 114017
Project: 114017
Buggy source:
private void startPrivateChatActivity(Dialog dialog){
  List<DialogOccupant> occupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(dialog.getDialogId());
  User occupant=ChatUtils.getOpponentFromPrivateDialog(UserFriendUtils.createLocalUser(qbUser),occupantsList);
  if (!TextUtils.isEmpty(dialog.getDialogId())) {
    PrivateDialogActivity.start(baseActivity,occupant,dialog);
  }
}

Fixed version (ground truth):
private void startPrivateChatActivity(Dialog dialog){
  List<DialogOccupant> occupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(dialog.getDialogId());
  User occupant=ChatUtils.getOpponentFromPrivateDialog(UserFriendUtils.createLocalUser(qbUser),occupantsList);
  boolean isFirstOpenDialog=!dataManager.getMessageDataManager().getTempMessagesByDialogId(dialog.getDialogId()).isEmpty();
  if (!TextUtils.isEmpty(dialog.getDialogId())) {
    if (!baseActivity.checkNetworkAvailableWithError() && isFirstOpenDialog) {
      return;
    }
    PrivateDialogActivity.start(baseActivity,occupant,dialog);
  }
}
Program: 114018
Project: 114018
Buggy source:
private void addToFriendList(final int userId){
  baseActivity.showProgress();
  QBAddFriendCommand.start(baseActivity,userId);
  KeyboardUtils.hideKeyboard(baseActivity);
}

Fixed version (ground truth):
private void addToFriendList(final int userId){
  if (!baseActivity.checkNetworkAvailableWithError()) {
    return;
  }
  baseActivity.showProgress();
  QBAddFriendCommand.start(baseActivity,userId);
  KeyboardUtils.hideKeyboard(baseActivity);
}
Program: 114019
Project: 114019
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (facebookHelper != null) {
    facebookHelper.onActivityResult(requestCode,resultCode,data);
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (facebookHelper != null && resultCode != Activity.RESULT_CANCELED) {
    facebookHelper.onActivityResult(requestCode,resultCode,data);
  }
 else {
    FacebookHelper.logout();
  }
}
Program: 114020
Project: 114020
Buggy source:
public void loginWithFacebook(){
  Session currentSession=Session.getActiveSession();
  if (currentSession == null || currentSession.getState().isClosed()) {
    Session session=new Session.Builder(activity).build();
    Session.setActiveSession(session);
    currentSession=session;
  }
  if (currentSession.isOpened()) {
    Session.openActiveSession(activity,true,facebookStatusCallback);
  }
 else {
    Session.OpenRequest openRequest=new Session.OpenRequest(activity);
    openRequest.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
    openRequest.setCallback(facebookStatusCallback);
    List<String> permissionsList=generatePermissionsList();
    openRequest.setPermissions(permissionsList);
    Session session=new Session.Builder(activity).build();
    Session.setActiveSession(session);
    session.openForPublish(openRequest);
  }
}

Fixed version (ground truth):
public void loginWithFacebook(){
  Session currentSession=Session.getActiveSession();
  if (currentSession == null || currentSession.getState().isClosed()) {
    Session session=new Session.Builder(activity).build();
    Session.setActiveSession(session);
    currentSession=session;
  }
  if (currentSession.isOpened()) {
    Session.openActiveSession(activity,true,facebookStatusCallback);
  }
 else {
    Session.OpenRequest openRequest=new Session.OpenRequest(activity);
    openRequest.setCallback(facebookStatusCallback);
    List<String> permissionsList=generatePermissionsList();
    openRequest.setPermissions(permissionsList);
    Session session=new Session.Builder(activity).build();
    Session.setActiveSession(session);
    session.openForPublish(openRequest);
  }
}
Program: 114021
Project: 114021
Buggy source:
private void initFields(Bundle savedInstanceState){
  title="String_Node_Str" + AppSession.getSession().getUser().getFullName();
  gsmHelper=new GSMHelper(this);
  importFriendsSuccessAction=new ImportFriendsSuccessAction();
  importFriendsFailAction=new ImportFriendsFailAction();
  if (!appSharedHelper.isUsersImportInitialized()) {
    showProgress();
    facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
    importFriendsHelper=new ImportFriendsHelper(MainActivity.this,facebookHelper);
  }
}

Fixed version (ground truth):
private void initFields(Bundle savedInstanceState){
  title="String_Node_Str" + AppSession.getSession().getUser().getFullName();
  gsmHelper=new GSMHelper(this);
  importFriendsSuccessAction=new ImportFriendsSuccessAction();
  importFriendsFailAction=new ImportFriendsFailAction();
  facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
}
Program: 114022
Project: 114022
Buggy source:
private void removeActions(){
  removeAction(QBServiceConsts.IMPORT_FRIENDS_SUCCESS_ACTION);
  removeAction(QBServiceConsts.IMPORT_FRIENDS_FAIL_ACTION);
  removeAction(QBServiceConsts.LOGIN_CHAT_COMPOSITE_SUCCESS_ACTION);
  removeAction(QBServiceConsts.LOAD_CHATS_DIALOGS_SUCCESS_ACTION);
  updateBroadcastActionList();
}

Fixed version (ground truth):
private void removeActions(){
  removeAction(QBServiceConsts.IMPORT_FRIENDS_SUCCESS_ACTION);
  removeAction(QBServiceConsts.IMPORT_FRIENDS_FAIL_ACTION);
  updateBroadcastActionList();
}
Program: 114023
Project: 114023
Buggy source:
private void deleteDialog(Dialog dialog){
  if (Dialog.Type.GROUP.equals(dialog.getType())) {
    if (groupChatHelper != null) {
      try {
        List<Integer> occupantsIdsList=new ArrayList<>();
        occupantsIdsList.add(qbUser.getId());
        groupChatHelper.sendGroupMessageToFriends(ChatUtils.createQBDialogFromLocalDialog(dataManager,dialog),DialogNotification.Type.OCCUPANTS_DIALOG,occupantsIdsList,true);
        DbUtils.deleteDialogLocal(dataManager,dialog.getDialogId());
      }
 catch (      QBResponseException e) {
        ErrorUtils.logError(e);
      }
    }
  }
  QBDeleteChatCommand.start(baseActivity,dialog.getDialogId(),dialog.getType());
}

Fixed version (ground truth):
private void deleteDialog(Dialog dialog){
  if (Dialog.Type.GROUP.equals(dialog.getType())) {
    if (groupChatHelper != null) {
      try {
        QBDialog localDialog=ChatUtils.createQBDialogFromLocalDialogWithoutLeaved(dataManager,dataManager.getDialogDataManager().getByDialogId(dialog.getDialogId()));
        List<Integer> occupantsIdsList=new ArrayList<>();
        occupantsIdsList.add(qbUser.getId());
        groupChatHelper.sendGroupMessageToFriends(localDialog,DialogNotification.Type.OCCUPANTS_DIALOG,occupantsIdsList,true);
        DbUtils.deleteDialogLocal(dataManager,dialog.getDialogId());
      }
 catch (      QBResponseException e) {
        ErrorUtils.logError(e);
      }
    }
  }
  QBDeleteChatCommand.start(baseActivity,dialog.getDialogId(),dialog.getType());
}
Program: 114024
Project: 114024
Buggy source:
private void startTimer(){
  if (!isStarted) {
    timerChronometer.setBase(SystemClock.elapsedRealtime());
    timerChronometer.start();
    isStarted=true;
  }
}

Fixed version (ground truth):
public void startTimer(){
  if (!isStarted) {
    timerChronometer.setVisibility(View.VISIBLE);
    timerChronometer.setBase(SystemClock.elapsedRealtime());
    timerChronometer.start();
    isStarted=true;
  }
}
Program: 114025
Project: 114025
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  opponentsList=null;
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  super.onDestroy();
  opponentsList=null;
  if (qbCallChatHelper != null) {
    qbCallChatHelper.releaseCurrentSession(CallActivity.this,CallActivity.this);
  }
}
Program: 114026
Project: 114026
Buggy source:
private void callToUser(User user,QBRTCTypes.QBConferenceType qbConferenceType){
  List<QBUser> qbUserList=new ArrayList<>(1);
  qbUserList.add(UserFriendUtils.createQbUser(user));
  CallActivity.start(PrivateDialogActivity.this,qbUserList,qbConferenceType,null);
}

Fixed version (ground truth):
private void callToUser(User user,QBRTCTypes.QBConferenceType qbConferenceType){
  if (!isChatInitializedAndUserLoggedIn()) {
    ToastUtils.longToast(R.string.call_chat_service_is_initializing);
    return;
  }
  List<QBUser> qbUserList=new ArrayList<>(1);
  qbUserList.add(UserFriendUtils.createQbUser(user));
  CallActivity.start(PrivateDialogActivity.this,qbUserList,qbConferenceType,null);
}
Program: 114027
Project: 114027
Buggy source:
private void callToUser(QBRTCTypes.QBConferenceType qbConferenceType){
  List<QBUser> qbUserList=new ArrayList<>(1);
  qbUserList.add(UserFriendUtils.createQbUser(user));
  CallActivity.start(this,qbUserList,qbConferenceType,null);
}

Fixed version (ground truth):
private void callToUser(QBRTCTypes.QBConferenceType qbConferenceType){
  if (!isChatInitializedAndUserLoggedIn()) {
    ToastUtils.longToast(R.string.call_chat_service_is_initializing);
    return;
  }
  List<QBUser> qbUserList=new ArrayList<>(1);
  qbUserList.add(UserFriendUtils.createQbUser(user));
  CallActivity.start(this,qbUserList,qbConferenceType,null);
}
Program: 114028
Project: 114028
Buggy source:
private void accept(){
  takeBtn.setClickable(false);
  stopCallNotification();
  ((CallActivity)getActivity()).addConversationFragmentReceiveCall();
  Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
private void accept(){
  takeBtn.setClickable(false);
  stopCallNotification();
  ((CallActivity)getActivity()).addConversationFragmentReceiveCall();
  ((CallActivity)getActivity()).startTimer();
  Log.d(TAG,"String_Node_Str");
}
Program: 114029
Project: 114029
Buggy source:
public void rejectCurrentSession(){
  if (qbCallChatHelper != null && qbCallChatHelper.getCurrentRtcSession() != null) {
    qbCallChatHelper.getCurrentRtcSession().rejectCall(new HashMap<String,String>());
  }
}

Fixed version (ground truth):
public void rejectCurrentSession(){
  if (qbCallChatHelper != null && qbCallChatHelper.getCurrentRtcSession() != null) {
    qbCallChatHelper.getCurrentRtcSession().rejectCall(new HashMap<String,String>());
  }
  finish();
}
Program: 114030
Project: 114030
Buggy source:
@Override public void onSessionClosed(final QBRTCSession session){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(TAG,"String_Node_Str" + session.getSessionID() + "String_Node_Str");
      if (session.equals(getCurrentSession())) {
        Fragment currentFragment=getCurrentFragment();
        if (isInComingCall) {
          stopIncomeCallTimer();
          if (currentFragment instanceof IncomingCallFragment) {
            removeFragment();
          }
        }
        Log.d(TAG,"String_Node_Str");
        if (qbCallChatHelper != null) {
          qbCallChatHelper.releaseCurrentSession(CallActivity.this,CallActivity.this);
        }
        stopTimer();
        closeByWifiStateAllow=true;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onSessionClosed(final QBRTCSession session){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      Log.d(TAG,"String_Node_Str" + session.getSessionID() + "String_Node_Str");
      if (session.equals(getCurrentSession())) {
        Fragment currentFragment=getCurrentFragment();
        if (isInComingCall) {
          stopIncomeCallTimer();
          if (currentFragment instanceof IncomingCallFragment) {
            removeFragment();
            finish();
          }
        }
        Log.d(TAG,"String_Node_Str");
        if (qbCallChatHelper != null) {
          qbCallChatHelper.releaseCurrentSession(CallActivity.this,CallActivity.this);
        }
        stopTimer();
        closeByWifiStateAllow=true;
      }
    }
  }
);
}
Program: 114031
Project: 114031
Buggy source:
@Override public void onConnectionClosedForUser(QBRTCSession session,Integer userID){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      Intent returnIntent=new Intent();
      setResult(CALL_ACTIVITY_CLOSE_WIFI_DISABLED,returnIntent);
      finish();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onConnectionClosedForUser(QBRTCSession session,Integer userID){
  runOnUiThread(new Runnable(){
    @Override public void run(){
      if (hangUpReason != null && hangUpReason.equals(QBServiceConsts.EXTRA_WIFI_DISABLED)) {
        Intent returnIntent=new Intent();
        setResult(CALL_ACTIVITY_CLOSE_WIFI_DISABLED,returnIntent);
      }
      finish();
    }
  }
);
}
Program: 114032
Project: 114032
Buggy source:
public void hangUpCurrentSession(){
  ringtonePlayer.stop();
  if (qbCallChatHelper != null && qbCallChatHelper.getCurrentRtcSession() != null) {
    qbCallChatHelper.getCurrentRtcSession().hangUp(new HashMap<String,String>());
  }
}

Fixed version (ground truth):
public void hangUpCurrentSession(){
  ringtonePlayer.stop();
  if (qbCallChatHelper != null && qbCallChatHelper.getCurrentRtcSession() != null) {
    qbCallChatHelper.getCurrentRtcSession().hangUp(new HashMap<String,String>());
  }
  finish();
}
Program: 114033
Project: 114033
Buggy source:
private void readAllMessages(){
  List<Message> messagesList=dataManager.getMessageDataManager().getMessagesByDialogId(dialog.getDialogId());
  dataManager.getMessageDataManager().createOrUpdateAll(ChatUtils.readAllMessages(messagesList,AppSession.getSession().getUser()));
  List<DialogNotification> dialogNotificationsList=dataManager.getDialogNotificationDataManager().getDialogNotificationsByDialogId(dialog.getDialogId());
  dataManager.getDialogNotificationDataManager().createOrUpdateAll(ChatUtils.readAllDialogNotification(dialogNotificationsList,AppSession.getSession().getUser()));
}

Fixed version (ground truth):
private void readAllMessages(){
  if (dialog != null) {
    List<Message> messagesList=dataManager.getMessageDataManager().getMessagesByDialogId(dialog.getDialogId());
    dataManager.getMessageDataManager().createOrUpdateAll(ChatUtils.readAllMessages(messagesList,AppSession.getSession().getUser()));
    List<DialogNotification> dialogNotificationsList=dataManager.getDialogNotificationDataManager().getDialogNotificationsByDialogId(dialog.getDialogId());
    dataManager.getDialogNotificationDataManager().createOrUpdateAll(ChatUtils.readAllDialogNotification(dialogNotificationsList,AppSession.getSession().getUser()));
  }
}
Program: 114034
Project: 114034
Buggy source:
@Override protected void onResume(){
  super.onResume();
  if (isNetworkAvailable()) {
    startLoadDialogMessages();
  }
  checkMessageSendingPossibility();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  checkForCorrectChat();
  if (isNetworkAvailable()) {
    startLoadDialogMessages();
  }
  checkMessageSendingPossibility();
}
Program: 114035
Project: 114035
Buggy source:
@OnClick(R.id.video_call_button) void videoCall(View view){
  ErrorUtils.showError(this,getString(R.string.coming_soon));
}

Fixed version (ground truth):
@OnClick(R.id.video_call_button) void videoCall(View view){
  callToUser(QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO);
}
Program: 114036
Project: 114036
Buggy source:
@OnClick(R.id.audio_call_button) void audioCall(View view){
  ErrorUtils.showError(this,getString(R.string.coming_soon));
}

Fixed version (ground truth):
@OnClick(R.id.audio_call_button) void audioCall(View view){
  callToUser(QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_AUDIO);
}
Program: 114037
Project: 114037
Buggy source:
private void reject(){
  rejectBtn.setClickable(false);
  Log.d(TAG,"String_Node_Str");
  stopCallNotification();
  ((CallActivity)getActivity()).rejectCurrentSession();
  getActivity().finish();
}

Fixed version (ground truth):
private void reject(){
  rejectBtn.setClickable(false);
  Log.d(TAG,"String_Node_Str");
  stopCallNotification();
  ((CallActivity)getActivity()).rejectCurrentSession();
}
Program: 114038
Project: 114038
Buggy source:
@Override public void initActionBar(){
  super.initActionBar();
  actionBarBridge.setActionBarUpButtonEnabled(false);
  checkVisibilityUserIcon();
}

Fixed version (ground truth):
@Override public void initActionBar(){
  super.initActionBar();
  actionBarBridge.setActionBarUpButtonEnabled(false);
  checkVisibilityUserIcon();
  loadingBridge.hideActionBarProgress();
}
Program: 114039
Project: 114039
Buggy source:
protected void parseExceptionMessage(Exception exception){
  hideProgress();
  String errorMessage=exception.getMessage();
  if (errorMessage != null) {
    if (errorMessage.equals(getString(R.string.error_bad_timestamp))) {
      errorMessage=getString(R.string.error_bad_timestamp_from_app);
    }
 else     if (errorMessage.equals(getString(R.string.error_login_or_email_required))) {
      errorMessage=getString(R.string.error_login_or_email_required_from_app);
    }
 else     if (errorMessage.equals(getString(R.string.error_email_already_taken)) && loginType.equals(LoginType.FACEBOOK)) {
      errorMessage=getString(R.string.error_email_already_taken_from_app);
    }
    ErrorUtils.showError(this,errorMessage);
  }
}

Fixed version (ground truth):
protected void parseExceptionMessage(Exception exception){
  hideProgress();
  String errorMessage=exception.getMessage();
  if (errorMessage != null) {
    if (errorMessage.equals(getString(R.string.error_bad_timestamp))) {
      errorMessage=getString(R.string.error_bad_timestamp_from_app);
    }
 else     if (errorMessage.equals(getString(R.string.error_login_or_email_required))) {
      errorMessage=getString(R.string.error_login_or_email_required_from_app);
    }
 else     if (errorMessage.equals(getString(R.string.error_email_already_taken)) && loginType.equals(LoginType.FACEBOOK)) {
      errorMessage=getString(R.string.error_email_already_taken_from_app);
    }
 else     if (errorMessage.equals(getString(R.string.error_unauthorized))) {
      errorMessage=getString(R.string.error_unauthorized_from_app);
    }
    ErrorUtils.showError(this,errorMessage);
  }
}
Program: 114040
Project: 114040
Buggy source:
private void initFields(){
  dataManager=DataManager.getInstance();
  String dialogId=(String)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG_ID);
  qbDialog=ChatUtils.createQBDialogFromLocalDialog(dataManager,dataManager.getDialogDataManager().getByDialogId(dialogId));
  imageUtils=new ImageUtils(this);
  friendOperationAction=new UserOperationAction();
  currentNotificationTypeList=new ArrayList<>();
  updatingDialogDetailsBroadcastReceiver=new UpdatingDialogDetailsBroadcastReceiver();
  occupantsList=dataManager.getUserDataManager().getUsersForGroupChat(qbDialog.getOccupants());
}

Fixed version (ground truth):
private void initFields(){
  dataManager=DataManager.getInstance();
  String dialogId=(String)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG_ID);
  qbDialog=ChatUtils.createQBDialogFromLocalDialog(dataManager,dataManager.getDialogDataManager().getByDialogId(dialogId));
  imageUtils=new ImageUtils(this);
  friendOperationAction=new UserOperationAction();
  currentNotificationTypeList=new ArrayList<>();
  updatingDialogDetailsBroadcastReceiver=new UpdatingDialogDetailsBroadcastReceiver();
  occupantsList=dataManager.getUserDataManager().getUsersForGroupChat(qbDialog.getDialogId(),qbDialog.getOccupants());
}
Program: 114041
Project: 114041
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: 114042
Project: 114042
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=UsersDatabaseManager.getUserById(activity,senderUserId);
  String message=extras.getString(QBServiceConsts.EXTRA_MESSAGE);
  String dialogId=ChatDatabaseManager.getPrivateDialogIdByOpponentId(activity,senderUserId);
  isPrivateMessage=true;
  if (isMessagesDialogCorrect(dialogId) && senderUser != null) {
    showNewMessageAlert(senderUser,message);
  }
}
Program: 114043
Project: 114043
Buggy source:
protected void showChatMessageNotification(Bundle extras){
  senderUser=(User)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  String message=extras.getString(QBServiceConsts.EXTRA_CHAT_MESSAGE);
  dialogId=extras.getString(QBServiceConsts.EXTRA_DIALOG_ID);
  isPrivateMessage=extras.getBoolean(QBServiceConsts.EXTRA_IS_PRIVATE_MESSAGE);
  if (isMessagesDialogCorrect(dialogId)) {
    showNewMessageAlert(senderUser,message);
  }
}

Fixed version (ground truth):
protected void showChatMessageNotification(Bundle extras){
  senderUser=(User)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  String message=extras.getString(QBServiceConsts.EXTRA_CHAT_MESSAGE);
  dialogId=extras.getString(QBServiceConsts.EXTRA_DIALOG_ID);
  isPrivateMessage=extras.getBoolean(QBServiceConsts.EXTRA_IS_PRIVATE_MESSAGE);
  if (isMessagesDialogCorrect(dialogId) && senderUser != null) {
    showNewMessageAlert(senderUser,message);
  }
}
Program: 114044
Project: 114044
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: 114045
Project: 114045
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: 114046
Project: 114046
Buggy source:
@Override public void onConnectionChange(boolean 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){
  if (isConnected) {
    QBReloginCommand.start(this);
  }
 else {
    showToastAboutDisconnectedIfNeed();
  }
}