nus-yam/ex-repair huggingface dataset:
Program: 114219
Project: 114219
Buggy source:
private void updateFriendList(Collection<User> newUserCollection){
  friendGroupAllUsers.addUserList(new ArrayList<User>(newUserCollection));
  friendGroupAllUsers.removeFriendsFromList(friendGroupAllFriends.getUserList());
  initFriendAdapter();
  performQueryTextChange();
}

Fixed version (ground truth):
private void updateFriendList(Collection<User> newUserCollection){
  friendGroupAllUsers.removeFriendsFromList(new ArrayList<User>(newUserCollection));
  friendGroupAllUsers.addUserList(new ArrayList<User>(newUserCollection));
  friendGroupAllUsers.removeFriendsFromList(friendGroupAllFriends.getUserList());
  initFriendAdapter();
  performQueryTextChange();
}
Program: 114220
Project: 114220
Buggy source:
private void checkVisibilityEmptyLabel(){
  if (state == State.GLOBAL_LIST) {
    emptyListTextView.setVisibility(View.GONE);
  }
 else {
    int countFriends=UsersDatabaseManager.getAllFriendsCountWithPending(baseActivity);
    if ((countFriends + friendGroupList.size()) > ConstsCore.ZERO_INT_VALUE) {
      emptyListTextView.setVisibility(View.GONE);
    }
 else {
      emptyListTextView.setVisibility(View.VISIBLE);
    }
  }
}

Fixed version (ground truth):
private void checkVisibilityEmptyLabel(){
  if (state == State.GLOBAL_LIST) {
    emptyListTextView.setVisibility(View.GONE);
  }
 else {
    int countFriends=UsersDatabaseManager.getAllFriendsCountWithPending(baseActivity);
    if ((countFriends + friendGroupAllUsers.getUserList().size()) > ConstsCore.ZERO_INT_VALUE) {
      emptyListTextView.setVisibility(View.GONE);
    }
 else {
      emptyListTextView.setVisibility(View.VISIBLE);
    }
  }
}
Program: 114221
Project: 114221
Buggy source:
private void removeActions(){
  baseActivity.removeAction(QBServiceConsts.ADD_FRIEND_SUCCESS_ACTION);
  baseActivity.removeAction(QBServiceConsts.ADD_FRIEND_FAIL_ACTION);
  baseActivity.removeAction(QBServiceConsts.FIND_USERS_SUCCESS_ACTION);
  baseActivity.removeAction(QBServiceConsts.FIND_USERS_FAIL_ACTION);
  baseActivity.removeAction(QBServiceConsts.LOAD_FRIENDS_SUCCESS_ACTION);
  baseActivity.removeAction(QBServiceConsts.LOAD_FRIENDS_FAIL_ACTION);
}

Fixed version (ground truth):
private void removeActions(){
  baseActivity.removeAction(QBServiceConsts.ADD_FRIEND_SUCCESS_ACTION);
  baseActivity.removeAction(QBServiceConsts.ADD_FRIEND_FAIL_ACTION);
  baseActivity.removeAction(QBServiceConsts.FIND_USERS_SUCCESS_ACTION);
  baseActivity.removeAction(QBServiceConsts.FIND_USERS_FAIL_ACTION);
}
Program: 114222
Project: 114222
Buggy source:
private void updateAllFriendsData(){
  firstVisiblePositionList=friendsListView.getFirstVisiblePosition();
  updateAllFriends();
  initFriendAdapter();
  if (!TextUtils.isEmpty(constraint)) {
    performQueryTextChange();
  }
  friendsListView.setSelection(firstVisiblePositionList);
}

Fixed version (ground truth):
private void updateAllFriendsData(){
  firstVisiblePositionList=friendsListView.getFirstVisiblePosition();
  updateAllFriends();
  initFriendAdapter();
  if (!TextUtils.isEmpty(constraint)) {
    performQueryTextChange();
  }
  checkVisibilityEmptyLabel();
  friendsListView.setSelection(firstVisiblePositionList);
}
Program: 114223
Project: 114223
Buggy source:
@Override public void execute(Bundle bundle){
  String notFoundError=getResources().getString(R.string.frl_not_found_users);
  showErrorToast(notFoundError);
  friendsListView.removeFooterView(listLoadingView);
  baseActivity.hideActionBarProgress();
}

Fixed version (ground truth):
@Override public void execute(Bundle bundle){
  String notFoundError=getResources().getString(R.string.frl_not_found_users);
  showErrorToast(notFoundError);
  checkVisibilityEmptyLabel();
  friendsListView.removeFooterView(listLoadingView);
  baseActivity.hideActionBarProgress();
}
Program: 114224
Project: 114224
Buggy source:
@Override public boolean onQueryTextChange(String query){
  if (state.equals(State.GLOBAL_LIST)) {
    constraint=query;
    page=1;
    initFriendList();
    checkUsersListLoader();
  }
  baseActivity.hideActionBarProgress();
  return true;
}

Fixed version (ground truth):
@Override public boolean onQueryTextChange(String query){
  if (state.equals(State.GLOBAL_LIST)) {
    constraint=query;
    page=1;
    initFriendList();
    if (!TextUtils.isEmpty(constraint)) {
      performQueryTextChange();
    }
 else {
      baseActivity.hideActionBarProgress();
    }
    checkUsersListLoader();
  }
  return true;
}
Program: 114225
Project: 114225
Buggy source:
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  inflater.inflate(R.menu.friend_list_menu,menu);
  searchOnActionExpandListener=new SearchOnActionExpandListener();
  MenuItem searchItem=menu.findItem(R.id.action_search);
  searchItem.setOnActionExpandListener(searchOnActionExpandListener);
  searchView=(SearchView)searchItem.getActionView();
  searchView.setOnQueryTextListener(this);
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  inflater.inflate(R.menu.friend_list_menu,menu);
  SearchOnActionExpandListener searchOnActionExpandListener=new SearchOnActionExpandListener();
  MenuItem searchItem=menu.findItem(R.id.action_search);
  searchItem.setOnActionExpandListener(searchOnActionExpandListener);
  searchView=(SearchView)searchItem.getActionView();
  searchView.setOnQueryTextListener(this);
}
Program: 114226
Project: 114226
Buggy source:
private void saveOpeningDialogData(Intent intent,int userId,String dialogId){
  if (userId != ConstsCore.ZERO_INT_VALUE && !TextUtils.isEmpty(dialogId)) {
    PrefsHelper prefsHelper=PrefsHelper.getPrefsHelper();
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_USER_ID,userId);
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_DIALOG_ID,dialogId);
    intent.putExtra(CLICKED_ON_PUSH,true);
  }
 else {
    intent.putExtra(CLICKED_ON_PUSH,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);
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,true);
  }
 else {
    prefsHelper.savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  }
}
Program: 114227
Project: 114227
Buggy source:
private void sendNotification(){
  notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  Intent intent=new Intent(this,SplashActivity.class);
  saveOpeningDialogData(intent,userId,dialogId);
  PendingIntent contentIntent=PendingIntent.getActivity(this,ConstsCore.ZERO_INT_VALUE,intent,PendingIntent.FLAG_UPDATE_CURRENT);
  NotificationCompat.Builder builder=new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setContentTitle(getString(R.string.push_title)).setStyle(new NotificationCompat.BigTextStyle().bigText(message)).setContentText(message).setVibrate(new long[]{ConstsCore.ZERO_INT_VALUE,VIBRATOR_DURATION});
  builder.setAutoCancel(true);
  builder.setContentIntent(contentIntent);
  builder.getNotification().flags|=Notification.FLAG_AUTO_CANCEL;
  notificationManager.notify(NOTIFICATION_ID,builder.build());
}

Fixed version (ground truth):
private void sendNotification(){
  notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  Intent intent=new Intent(this,SplashActivity.class);
  saveOpeningDialogData(userId,dialogId);
  PendingIntent contentIntent=PendingIntent.getActivity(this,ConstsCore.ZERO_INT_VALUE,intent,PendingIntent.FLAG_UPDATE_CURRENT);
  NotificationCompat.Builder builder=new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setContentTitle(getString(R.string.push_title)).setStyle(new NotificationCompat.BigTextStyle().bigText(message)).setContentText(message).setVibrate(new long[]{ConstsCore.ZERO_INT_VALUE,VIBRATOR_DURATION});
  builder.setAutoCancel(true);
  builder.setContentIntent(contentIntent);
  builder.getNotification().flags|=Notification.FLAG_AUTO_CANCEL;
  notificationManager.notify(NOTIFICATION_ID,builder.build());
}
Program: 114228
Project: 114228
Buggy source:
@Override public void onReceiveRefreshSessionAction(Bundle extras){
  DialogUtils.show(BaseActivity.this,getString(R.string.dlg_refresh_session));
  showProgress();
  activityHelper.refreshSession();
}

Fixed version (ground truth):
@Override public void onReceiveRefreshSessionAction(Bundle extras){
  DialogUtils.show(BaseActivity.this,getString(R.string.dlg_refresh_session));
  activityHelper.refreshSession();
}
Program: 114229
Project: 114229
Buggy source:
@Override public void onReceiveRefreshSessionAction(Bundle extras){
  DialogUtils.show(BaseFragmentActivity.this,getString(R.string.dlg_refresh_session));
  showProgress();
  activityHelper.refreshSession();
}

Fixed version (ground truth):
@Override public void onReceiveRefreshSessionAction(Bundle extras){
  DialogUtils.show(BaseFragmentActivity.this,getString(R.string.dlg_refresh_session));
  activityHelper.refreshSession();
}
Program: 114230
Project: 114230
Buggy source:
private void checkMessageSendingPossibility(){
  boolean isFriend=UsersDatabaseManager.isFriendInBase(PrivateDialogActivity.this,opponentFriend.getUserId());
  messageEditText.setEnabled(isFriend);
}

Fixed version (ground truth):
private void checkMessageSendingPossibility(){
  boolean isFriend=UsersDatabaseManager.isFriendInBase(PrivateDialogActivity.this,opponentFriend.getUserId());
  messageEditText.setEnabled(isFriend);
  smilePanelImageButton.setEnabled(isFriend);
}
Program: 114231
Project: 114231
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  useDoubleBackPressed=true;
  gsmHelper=new GSMHelper(this);
  initNavigationDrawer();
  if (!isImportInitialized()) {
    showProgress();
    facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
    importFriends=new ImportFriends(MainActivity.this,facebookHelper);
    PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_SIGN_UP_INITIALIZED,false);
  }
  showActionBarProgress();
  initBroadcastActionList();
  checkGCMRegistration();
  loadFriendsList();
  initVideoChat();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  useDoubleBackPressed=true;
  gsmHelper=new GSMHelper(this);
  initNavigationDrawer();
  if (!isImportInitialized()) {
    showProgress();
    facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
    importFriends=new ImportFriends(MainActivity.this,facebookHelper);
    PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_SIGN_UP_INITIALIZED,false);
  }
  initBroadcastActionList();
  checkGCMRegistration();
  loadFriendsList();
  initVideoChat();
}
Program: 114232
Project: 114232
Buggy source:
@Override protected void onResume(){
  super.onResume();
  gsmHelper.checkPlayServices();
  checkVisibilityProgressBars();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  gsmHelper.checkPlayServices();
  showActionBarProgress();
  checkVisibilityProgressBars();
}
Program: 114233
Project: 114233
Buggy source:
private void checkVisibilityProgressBars(){
  isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isNeedToOpenDialog) {
    hideActionBarProgress();
    showProgress();
  }
 else {
    hideProgress();
  }
}

Fixed version (ground truth):
private void checkVisibilityProgressBars(){
  isNeedToOpenDialog=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,false);
  if (isJoinedToDialogs()) {
    hideActionBarProgress();
  }
  if (isNeedToOpenDialog && !isJoinedToDialogs()) {
    hideActionBarProgress();
    showProgress();
  }
}
Program: 114234
Project: 114234
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Crashlytics.start(this);
  addActions();
  facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
  String userEmail=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_USER_EMAIL);
  String userPassword=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_USER_PASSWORD);
  boolean isRememberMe=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_REMEMBER_ME,false);
  if (getIntent().hasExtra(GCMIntentService.CLICKED_ON_PUSH)) {
    PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_PUSH_MESSAGE_NEED_TO_OPEN_DIALOG,getIntent().getBooleanExtra(GCMIntentService.CLICKED_ON_PUSH,false));
  }
  if (isRememberMe) {
    checkStartExistSession(userEmail,userPassword);
  }
 else {
    startLanding();
  }
  setContentView(R.layout.activity_splash);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Crashlytics.start(this);
  addActions();
  facebookHelper=new FacebookHelper(this,savedInstanceState,new FacebookSessionStatusCallback());
  String userEmail=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_USER_EMAIL);
  String userPassword=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_USER_PASSWORD);
  boolean isRememberMe=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_REMEMBER_ME,false);
  if (isRememberMe) {
    checkStartExistSession(userEmail,userPassword);
  }
 else {
    startLanding();
  }
  setContentView(R.layout.activity_splash);
}
Program: 114235
Project: 114235
Buggy source:
@Override public void execute(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_IMPORT_INITIALIZED,true);
  startMainActivity();
  AnalyticsUtils.pushAnalyticsData(SplashActivity.this,user,"String_Node_Str");
  finish();
}

Fixed version (ground truth):
@Override public void execute(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  startMainActivity();
  AnalyticsUtils.pushAnalyticsData(SplashActivity.this,user,"String_Node_Str");
  finish();
}
Program: 114236
Project: 114236
Buggy source:
private void startMainActivity(){
  MainActivity.start(SplashActivity.this);
}

Fixed version (ground truth):
private void startMainActivity(){
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_IMPORT_INITIALIZED,true);
  MainActivity.start(SplashActivity.this);
}
Program: 114237
Project: 114237
Buggy source:
public static ImageLoaderConfiguration getImageLoaderConfiguration(Context context){
  final int MEMORY_CACHE_LIMIT=2 * 1024 * 1024;
  final int THREAD_POOL_SIZE=5;
  final int COMPRESS_QUALITY=60;
  final int MAX_IMAGE_WIDTH_FOR_MEMORY_CACHE=600;
  final int MAX_IMAGE_HEIGHT_FOR_MEMORY_CACHE=1200;
  ImageLoaderConfiguration imageLoaderConfiguration=new ImageLoaderConfiguration.Builder(context).memoryCacheExtraOptions(MAX_IMAGE_WIDTH_FOR_MEMORY_CACHE,MAX_IMAGE_HEIGHT_FOR_MEMORY_CACHE).discCacheExtraOptions(MAX_IMAGE_WIDTH_FOR_MEMORY_CACHE,MAX_IMAGE_HEIGHT_FOR_MEMORY_CACHE,Bitmap.CompressFormat.JPEG,COMPRESS_QUALITY,null).threadPoolSize(THREAD_POOL_SIZE).threadPriority(Thread.NORM_PRIORITY).denyCacheImageMultipleSizesInMemory().memoryCache(new UsingFreqLimitedMemoryCache(MEMORY_CACHE_LIMIT)).writeDebugLogs().defaultDisplayImageOptions(Consts.UIL_DEFAULT_DISPLAY_OPTIONS).imageDecoder(new SmartUriDecoder(context,new BaseImageDecoder(false))).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new HashCodeFileNameGeneratorWithoutToken()).build();
  return imageLoaderConfiguration;
}

Fixed version (ground truth):
public static ImageLoaderConfiguration getImageLoaderConfiguration(Context context){
  final int MEMORY_CACHE_LIMIT=2 * 1024 * 1024;
  final int THREAD_POOL_SIZE=5;
  ImageLoaderConfiguration imageLoaderConfiguration=new ImageLoaderConfiguration.Builder(context).threadPoolSize(THREAD_POOL_SIZE).threadPriority(Thread.NORM_PRIORITY).denyCacheImageMultipleSizesInMemory().memoryCache(new UsingFreqLimitedMemoryCache(MEMORY_CACHE_LIMIT)).writeDebugLogs().defaultDisplayImageOptions(Consts.UIL_DEFAULT_DISPLAY_OPTIONS).imageDecoder(new SmartUriDecoder(context,new BaseImageDecoder(false))).denyCacheImageMultipleSizesInMemory().discCacheFileNameGenerator(new HashCodeFileNameGeneratorWithoutToken()).build();
  return imageLoaderConfiguration;
}
Program: 114238
Project: 114238
Buggy source:
protected void startMainActivity(Context context,QBUser user,boolean saveRememberMe){
  AppSession.getSession().updateUser(user);
  AppSession.saveRememberMe(saveRememberMe);
  ChatDatabaseManager.clearAllCache(context);
  MainActivity.start(context);
  finish();
}

Fixed version (ground truth):
protected void startMainActivity(Context context,QBUser user,boolean saveRememberMe){
  ChatDatabaseManager.clearAllCache(context);
  AppSession.getSession().updateUser(user);
  AppSession.saveRememberMe(saveRememberMe);
  MainActivity.start(context);
  finish();
}
Program: 114239
Project: 114239
Buggy source:
private QBUser createUserForUpdating(){
  QBUser newUser=new QBUser();
  newUser.setId(user.getId());
  if (isFieldValueChanged(fullNameCurrent,fullNameOld)) {
    user.setFullName(fullNameCurrent);
    newUser.setFullName(fullNameCurrent);
  }
  if (isFieldValueChanged(phoneCurrent,phoneOld)) {
    user.setPhone(phoneCurrent);
    newUser.setPhone(phoneCurrent);
  }
  if (isFieldValueChanged(statusCurrent,statusOld)) {
    userCustomData.setStatus(statusCurrent);
    user.setCustomData(Utils.customDataToString(userCustomData));
    newUser.setCustomData(Utils.customDataToString(userCustomData));
  }
  return newUser;
}

Fixed version (ground truth):
private QBUser createUserForUpdating(){
  QBUser newUser=new QBUser();
  newUser.setId(user.getId());
  if (isFieldValueChanged(fullNameCurrent,fullNameOld)) {
    user.setFullName(fullNameCurrent);
    newUser.setFullName(fullNameCurrent);
  }
  if (isFieldValueChanged(phoneCurrent,phoneOld)) {
    user.setPhone(phoneCurrent);
    newUser.setPhone(phoneCurrent);
  }
  if (isFieldValueChanged(statusCurrent,statusOld) || isNeedUpdateAvatar) {
    userCustomData.setStatus(statusCurrent);
    user.setCustomData(Utils.customDataToString(userCustomData));
  }
  newUser.setCustomData(Utils.customDataToString(userCustomData));
  return newUser;
}
Program: 114240
Project: 114240
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == Crop.REQUEST_CROP) {
    handleCrop(resultCode,data);
  }
 else   if (requestCode == ImageUtils.GALLERY_INTENT_CALLED && resultCode == RESULT_OK) {
    Uri originalUri=data.getData();
    if (originalUri != null) {
      showProgress();
      new ReceiveUriScaledBitmapTask(this).execute(imageUtils,originalUri);
    }
  }
  canPerformLogout.set(true);
  super.onActivityResult(requestCode,resultCode,data);
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == Crop.REQUEST_CROP) {
    handleCrop(resultCode,data);
  }
 else   if (requestCode == ImageUtils.GALLERY_INTENT_CALLED && resultCode == RESULT_OK) {
    Uri originalUri=data.getData();
    if (originalUri != null) {
      showProgress();
      new ReceiveUriScaledBitmapTask(this).execute(imageUtils,originalUri);
    }
  }
  super.onActivityResult(requestCode,resultCode,data);
}
Program: 114241
Project: 114241
Buggy source:
private void handleCrop(int resultCode,Intent result){
  if (resultCode == RESULT_OK) {
    isNeedUpdateAvatar=true;
    avatarBitmapCurrent=imageUtils.getBitmap(outputUri);
    avatarImageView.setImageBitmap(avatarBitmapCurrent);
    showAction();
  }
 else   if (resultCode == Crop.RESULT_ERROR) {
    DialogUtils.showLong(this,Crop.getError(result).getMessage());
  }
}

Fixed version (ground truth):
private void handleCrop(int resultCode,Intent result){
  if (resultCode == RESULT_OK) {
    isNeedUpdateAvatar=true;
    avatarBitmapCurrent=imageUtils.getBitmap(outputUri);
    avatarImageView.setImageBitmap(avatarBitmapCurrent);
    showAction();
  }
 else   if (resultCode == Crop.RESULT_ERROR) {
    DialogUtils.showLong(this,Crop.getError(result).getMessage());
  }
  canPerformLogout.set(true);
}
Program: 114242
Project: 114242
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);
  user.setOldPassword(user.getPassword());
  int authorizationType=extras.getInt(QBServiceConsts.AUTH_ACTION_TYPE,ConstsCore.NOT_INITIALIZED_VALUE);
  Bundle result=new Bundle();
  if (isLoggedViaFB(user,authorizationType)) {
    result.putSerializable(QBServiceConsts.EXTRA_USER,user);
    return result;
  }
  updateUser(user,file);
  result.putSerializable(QBServiceConsts.EXTRA_USER,user);
  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);
  user.setOldPassword(user.getPassword());
  int authorizationType=extras.getInt(QBServiceConsts.AUTH_ACTION_TYPE,ConstsCore.NOT_INITIALIZED_VALUE);
  Bundle result=new Bundle();
  if (isLoggedViaFB(user,authorizationType)) {
    result.putSerializable(QBServiceConsts.EXTRA_USER,user);
    return result;
  }
  QBUser newUser=updateUser(user,file);
  result.putSerializable(QBServiceConsts.EXTRA_USER,newUser);
  return result;
}
Program: 114243
Project: 114243
Buggy source:
private void updateUser(QBUser user,File file) throws QBResponseException, SmackException.NotConnectedException {
  if (file == null) {
    authHelper.updateUser(user);
  }
 else {
    authHelper.updateUser(user,file);
  }
}

Fixed version (ground truth):
private QBUser updateUser(QBUser user,File file) throws QBResponseException, SmackException.NotConnectedException {
  if (file == null) {
    return authHelper.updateUser(user);
  }
 else {
    return authHelper.updateUser(user,file);
  }
}
Program: 114244
Project: 114244
Buggy source:
@Override public void onStartSessionSuccess(){
  unregisterBroadcastReceiver();
  sendNotification();
}

Fixed version (ground truth):
@Override public void onStartSessionSuccess(){
  loginHelper.loginChat();
}
Program: 114245
Project: 114245
Buggy source:
private void registerCommandBroadcastReceiver(){
  IntentFilter intentFilter=new IntentFilter();
  intentFilter.addAction(QBServiceConsts.COMMAND_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_SUCCESS_ACTION);
  intentFilter.addAction(QBServiceConsts.SOCIAL_LOGIN_SUCCESS_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_FAIL_ACTION);
  intentFilter.addAction(QBServiceConsts.SOCIAL_LOGIN_FAIL_ACTION);
  intentFilter.addAction(QBServiceConsts.SIGNUP_FAIL_ACTION);
  LocalBroadcastManager.getInstance(this).registerReceiver(commandBroadcastReceiver,intentFilter);
}

Fixed version (ground truth):
private void registerCommandBroadcastReceiver(){
  IntentFilter intentFilter=new IntentFilter();
  intentFilter.addAction(QBServiceConsts.COMMAND_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_SUCCESS_ACTION);
  intentFilter.addAction(QBServiceConsts.SOCIAL_LOGIN_SUCCESS_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_FAIL_ACTION);
  intentFilter.addAction(QBServiceConsts.SOCIAL_LOGIN_FAIL_ACTION);
  intentFilter.addAction(QBServiceConsts.SIGNUP_FAIL_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_CHAT_COMPOSITE_SUCCESS_ACTION);
  intentFilter.addAction(QBServiceConsts.LOGIN_CHAT_COMPOSITE_FAIL_ACTION);
  LocalBroadcastManager.getInstance(this).registerReceiver(commandBroadcastReceiver,intentFilter);
}
Program: 114246
Project: 114246
Buggy source:
private void parseMessage(Bundle extras){
  prefsHelper=PrefsHelper.getPrefsHelper();
  if (extras.getString(NotificationHelper.MESSAGE) != null) {
    message=extras.getString(NotificationHelper.MESSAGE);
  }
  if (extras.getString(NotificationHelper.USER_ID) != null) {
    userId=Integer.parseInt(extras.getString(NotificationHelper.USER_ID));
  }
  if (extras.getString(NotificationHelper.DIALOG_ID) != null) {
    dialogId=extras.getString(NotificationHelper.DIALOG_ID);
  }
  boolean chatPush=userId != ConstsCore.ZERO_INT_VALUE && !TextUtils.isEmpty(dialogId);
  if (chatPush) {
    saveOpeningDialogData(userId,dialogId,true);
    commandBroadcastReceiver=new CommandBroadcastReceiver();
    registerCommandBroadcastReceiver();
    boolean checkedRememberMe=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_REMEMBER_ME);
    LoginHelper loginHelper=new LoginHelper(this,this,checkedRememberMe);
    loginHelper.checkStartExistSession();
  }
 else {
    saveOpeningDialogData(false);
    sendNotification();
  }
}

Fixed version (ground truth):
private void parseMessage(Bundle extras){
  prefsHelper=PrefsHelper.getPrefsHelper();
  if (extras.getString(NotificationHelper.MESSAGE) != null) {
    message=extras.getString(NotificationHelper.MESSAGE);
  }
  if (extras.getString(NotificationHelper.USER_ID) != null) {
    userId=Integer.parseInt(extras.getString(NotificationHelper.USER_ID));
  }
  if (extras.getString(NotificationHelper.DIALOG_ID) != null) {
    dialogId=extras.getString(NotificationHelper.DIALOG_ID);
  }
  boolean chatPush=userId != ConstsCore.ZERO_INT_VALUE && !TextUtils.isEmpty(dialogId);
  if (chatPush) {
    saveOpeningDialogData(userId,dialogId,true);
    commandBroadcastReceiver=new CommandBroadcastReceiver();
    registerCommandBroadcastReceiver();
    boolean checkedRememberMe=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_REMEMBER_ME);
    loginHelper=new LoginHelper(this,this,checkedRememberMe);
    loginHelper.checkStartExistSession();
  }
 else {
    saveOpeningDialogData(false);
    sendNotification();
  }
}
Program: 114247
Project: 114247
Buggy source:
@Override public void onReceive(Context context,final Intent intent){
  final String action=intent.getAction();
  return;
}

Fixed version (ground truth):
@Override public void onReceive(Context context,final Intent intent){
  if (intent.getAction().equals(QBServiceConsts.LOGIN_CHAT_COMPOSITE_SUCCESS_ACTION)) {
    saveOpeningDialogData(true);
  }
 else   if (intent.getAction().equals(QBServiceConsts.LOGIN_CHAT_COMPOSITE_FAIL_ACTION)) {
    saveOpeningDialogData(false);
  }
  sendNotification();
}
Program: 114248
Project: 114248
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  isPushForbidden=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_NOTIFICATIONS,false);
  if (isPushForbidden) {
    return;
  }
  ComponentName comp=new ComponentName(context.getPackageName(),GCMIntentService.class.getName());
  startWakefulService(context,(intent.setComponent(comp)));
  setResultCode(Activity.RESULT_OK);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  boolean isPushForbidden=PrefsHelper.getPrefsHelper().getPref(PrefsHelper.PREF_PUSH_NOTIFICATIONS,false);
  if (isPushForbidden) {
    return;
  }
  ComponentName comp=new ComponentName(context.getPackageName(),GCMIntentService.class.getName());
  startWakefulService(context,(intent.setComponent(comp)));
  setResultCode(Activity.RESULT_OK);
}
Program: 114249
Project: 114249
Buggy source:
private void loginWithFacebook(){
  FacebookHelper.logout();
  facebookHelper.loginWithFacebook();
}

Fixed version (ground truth):
private void loginWithFacebook(){
  ChatDatabaseManager.clearAllCache(this);
  AppSession.saveRememberMe(true);
  showProgress();
  FacebookHelper.logout();
  facebookHelper.loginWithFacebook();
}
Program: 114250
Project: 114250
Buggy source:
protected void login(String userEmail,String userPassword){
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_IMPORT_INITIALIZED,true);
  QBUser user=new QBUser(null,userPassword,userEmail);
  AppSession.getSession().closeAndClear();
  QBLoginCompositeCommand.start(this,user);
}

Fixed version (ground truth):
protected void login(String userEmail,String userPassword){
  AppSession.saveRememberMe(checkedRememberMe);
  PrefsHelper.getPrefsHelper().savePref(PrefsHelper.PREF_IMPORT_INITIALIZED,true);
  QBUser user=new QBUser(null,userPassword,userEmail);
  AppSession.getSession().closeAndClear();
  QBLoginCompositeCommand.start(this,user);
}
Program: 114251
Project: 114251
Buggy source:
protected void performLoginSuccessAction(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  startMainActivity(BaseAuthActivity.this,user,checkedRememberMe);
  AnalyticsUtils.pushAnalyticsData(BaseAuthActivity.this,user,"String_Node_Str");
}

Fixed version (ground truth):
protected void performLoginSuccessAction(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  startMainActivity(BaseAuthActivity.this,user);
  AnalyticsUtils.pushAnalyticsData(BaseAuthActivity.this,user,"String_Node_Str");
}
Program: 114252
Project: 114252
Buggy source:
@Override public void call(Session session,SessionState state,Exception exception){
  if (session.isOpened()) {
    showProgress();
    AppSession.getSession().closeAndClear();
    QBSocialLoginCommand.start(BaseAuthActivity.this,QBProvider.FACEBOOK,session.getAccessToken(),null);
  }
}

Fixed version (ground truth):
@Override public void call(Session session,SessionState state,Exception exception){
  if (session.isOpened()) {
    checkedRememberMe=true;
    AppSession.getSession().closeAndClear();
    QBSocialLoginCommand.start(BaseAuthActivity.this,QBProvider.FACEBOOK,session.getAccessToken(),null);
  }
}
Program: 114253
Project: 114253
Buggy source:
public void loginOnClickListener(View view){
  String userEmail=emailEditText.getText().toString();
  String userPassword=passwordEditText.getText().toString();
  initCheckedRememberMe();
  if (validationUtils.isValidUserDate(userEmail,userPassword)) {
    showProgress();
    login(userEmail,userPassword);
  }
}

Fixed version (ground truth):
public void loginOnClickListener(View view){
  String userEmail=emailEditText.getText().toString();
  String userPassword=passwordEditText.getText().toString();
  if (validationUtils.isValidUserDate(userEmail,userPassword)) {
    showProgress();
    ChatDatabaseManager.clearAllCache(this);
    initCheckedRememberMe();
    login(userEmail,userPassword);
  }
}
Program: 114254
Project: 114254
Buggy source:
protected void performUpdateUserSuccessAction(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  startMainActivity(SignUpActivity.this,user,true);
  AnalyticsUtils.pushAnalyticsData(SignUpActivity.this,user,"String_Node_Str");
}

Fixed version (ground truth):
protected void performUpdateUserSuccessAction(Bundle bundle){
  QBUser user=(QBUser)bundle.getSerializable(QBServiceConsts.EXTRA_USER);
  AppSession.saveRememberMe(true);
  startMainActivity(SignUpActivity.this,user);
  AnalyticsUtils.pushAnalyticsData(SignUpActivity.this,user,"String_Node_Str");
}
Program: 114255
Project: 114255
Buggy source:
private void startSignUp(File imageFile){
  AppSession.getSession().closeAndClear();
  QBSignUpCommand.start(SignUpActivity.this,user,imageFile);
}

Fixed version (ground truth):
private void startSignUp(File imageFile){
  ChatDatabaseManager.clearAllCache(this);
  AppSession.getSession().closeAndClear();
  QBSignUpCommand.start(SignUpActivity.this,user,imageFile);
}
Program: 114256
Project: 114256
Buggy source:
@Override public void onStartSessionSuccess(){
  startMainActivity();
  finish();
}

Fixed version (ground truth):
@Override public void onStartSessionSuccess(){
  checkedRememberMe=true;
  startMainActivity();
  finish();
}
Program: 114257
Project: 114257
Buggy source:
public void showNewMessageAlert(User senderUser,String message){
  newMessageTextView.setText(message);
  senderMessageTextView.setText(senderUser.getFullName());
  Crouton.cancelAllCroutons();
  Crouton.show(activity,newMessageView);
}

Fixed version (ground truth):
public void showNewMessageAlert(User senderUser,String message){
  if (senderUser == null) {
    return;
  }
  newMessageTextView.setText(message);
  senderMessageTextView.setText(senderUser.getFullName());
  Crouton.cancelAllCroutons();
  Crouton.show(activity,newMessageView);
}
Program: 114258
Project: 114258
Buggy source:
private void setOnlineStatus(User friend){
  ActionBar actionBar=getActionBar();
  actionBar.setSubtitle(friend.getOnlineStatus(this));
}

Fixed version (ground truth):
private void setOnlineStatus(User friend){
  if (friend != null) {
    ActionBar actionBar=getActionBar();
    actionBar.setSubtitle(friend.getOnlineStatus(this));
  }
}
Program: 114259
Project: 114259
Buggy source:
protected abstract void onFileSelected(Uri originalUri);

Fixed version (ground truth):
protected abstract void onFileSelected(Bitmap bitmap);
Program: 114260
Project: 114260
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  canPerformLogout.set(true);
  if ((isGalleryCalled(requestCode) || isCaptureCalled(requestCode)) && resultCode == RESULT_OK) {
    isNeedToScrollMessages=true;
    onFileSelected(data.getData());
  }
  super.onActivityResult(requestCode,resultCode,data);
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  canPerformLogout.set(true);
  if ((isGalleryCalled(requestCode) || isCaptureCalled(requestCode)) && resultCode == RESULT_OK) {
    isNeedToScrollMessages=true;
    if (data.getData() == null) {
      onFileSelected((Bitmap)data.getExtras().get("String_Node_Str"));
    }
 else {
      onFileSelected(data.getData());
    }
  }
  super.onActivityResult(requestCode,resultCode,data);
}
Program: 114261
Project: 114261
Buggy source:
protected void startLoadAttachFile(final File file){
  AlertDialog alertDialog=AlertDialog.newInstance(getResources().getString(R.string.dlg_confirm_sending_attach));
  alertDialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      showProgress();
      QBLoadAttachFileCommand.start(BaseDialogActivity.this,file);
    }
  }
);
  alertDialog.show(getFragmentManager(),null);
}

Fixed version (ground truth):
protected void startLoadAttachFile(final File file){
  final AlertDialog alertDialog=AlertDialog.newInstance(getResources().getString(R.string.dlg_confirm_sending_attach));
  alertDialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      showProgress();
      QBLoadAttachFileCommand.start(BaseDialogActivity.this,file);
    }
  }
);
  alertDialog.setNegativeButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      alertDialog.dismiss();
    }
  }
);
  alertDialog.show(getFragmentManager(),null);
}
Program: 114262
Project: 114262
Buggy source:
@Override protected void onFileSelected(Uri originalUri){
  Bitmap bitmap=imageUtils.getBitmap(originalUri);
  new ReceiveFileFromBitmapTask(GroupDialogActivity.this).execute(imageUtils,bitmap,true);
}

Fixed version (ground truth):
@Override protected void onFileSelected(Bitmap bitmap){
  new ReceiveFileFromBitmapTask(GroupDialogActivity.this).execute(imageUtils,bitmap,true);
}
Program: 114263
Project: 114263
Buggy source:
protected void onReceiveMessage(Bundle extras){
  senderUser=(User)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  String message=extras.getString(QBServiceConsts.EXTRA_CHAT_MESSAGE);
  String dialogId=extras.getString(QBServiceConsts.EXTRA_DIALOG_ID);
  messagesDialog=ChatDatabaseManager.getDialogByDialogId(activity,dialogId);
  isPrivateMessage=extras.getBoolean(QBServiceConsts.EXTRA_IS_PRIVATE_MESSAGE);
  showNewMessageAlert(senderUser,message);
}

Fixed version (ground truth):
protected void onReceiveMessage(Bundle extras){
  senderUser=(User)extras.getSerializable(QBServiceConsts.EXTRA_USER);
  String message=extras.getString(QBServiceConsts.EXTRA_CHAT_MESSAGE);
  String dialogId=extras.getString(QBServiceConsts.EXTRA_DIALOG_ID);
  messagesDialog=ChatDatabaseManager.getDialogByDialogId(activity,dialogId);
  isPrivateMessage=extras.getBoolean(QBServiceConsts.EXTRA_IS_PRIVATE_MESSAGE);
  if (messagesDialog != null) {
    showNewMessageAlert(senderUser,message);
  }
}
Program: 114264
Project: 114264
Buggy source:
@Override public void onReceiveChatMessageAction(Bundle extras){
  boolean isSplashActivity=activityHelper.getContext() instanceof SplashActivity;
  if (!isSplashActivity) {
    activityHelper.onReceiveMessage(extras);
  }
}

Fixed version (ground truth):
@Override public void onReceiveChatMessageAction(Bundle extras){
  boolean isSplashActivity=activityHelper.getContext() instanceof SplashActivity;
  boolean isCallActivity=activityHelper.getContext() instanceof CallActivity;
  if (!isSplashActivity && !isCallActivity) {
    activityHelper.onReceiveMessage(extras);
  }
}
Program: 114265
Project: 114265
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  canPerformLogout.set(true);
  if (isGalleryCalled(requestCode) && resultCode == RESULT_OK) {
    isNeedToScrollMessages=true;
    onFileSelected(data.getData());
  }
  super.onActivityResult(requestCode,resultCode,data);
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  canPerformLogout.set(true);
  if ((isGalleryCalled(requestCode) || isCaptureCalled(requestCode)) && resultCode == RESULT_OK) {
    isNeedToScrollMessages=true;
    onFileSelected(data.getData());
  }
  super.onActivityResult(requestCode,resultCode,data);
}
Program: 114266
Project: 114266
Buggy source:
protected void startLoadAttachFile(File file){
  showProgress();
  QBLoadAttachFileCommand.start(this,file);
}

Fixed version (ground truth):
protected void startLoadAttachFile(final File file){
  AlertDialog alertDialog=AlertDialog.newInstance(getResources().getString(R.string.dlg_confirm_sending_attach));
  alertDialog.setPositiveButton(new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      showProgress();
      QBLoadAttachFileCommand.start(BaseDialogActivity.this,file);
    }
  }
);
  alertDialog.show(getFragmentManager(),null);
}
Program: 114267
Project: 114267
Buggy source:
protected void attachButtonOnClick(){
  canPerformLogout.set(false);
  imageUtils.getImage();
}

Fixed version (ground truth):
protected void attachButtonOnClick(){
  canPerformLogout.set(false);
  CharSequence[] itemsArray=resources.getStringArray(R.array.dlg_attach_types_array);
  Dialog dialog=DialogUtils.createSingleChoiceItemsDialog(this,resources.getString(R.string.dlg_select_attach_type),itemsArray,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int item){
switch (item) {
case 0:
        imageUtils.getCaptureImage();
      break;
case 1:
    imageUtils.getImage();
  break;
}
dialog.dismiss();
}
}
);
dialog.show();
}
Program: 114268
Project: 114268
Buggy source:
@Override public void execute(Bundle bundle){
  Exception exception=(Exception)bundle.getSerializable(QBServiceConsts.EXTRA_ERROR);
  String errorMessage=exception.getMessage();
  if (exception.getMessage().equals(resources.getString(R.string.error_bad_timestamp))) {
    errorMessage=resources.getString(R.string.error_bad_timestamp_from_app);
  }
 else   if (exception.getMessage().equals(resources.getString(R.string.error_email_already_taken)) && startedLoginType.equals(LoginType.FACEBOOK)) {
    errorMessage=resources.getString(R.string.error_email_already_taken_from_app);
  }
  DialogUtils.showLong(LandingActivity.this,errorMessage);
  hideProgress();
}

Fixed version (ground truth):
@Override public void execute(Bundle bundle){
  Exception exception=(Exception)bundle.getSerializable(QBServiceConsts.EXTRA_ERROR);
  int errorCode=bundle.getInt(QBServiceConsts.EXTRA_ERROR_CODE);
  parseExceptionMessage(exception);
}
Program: 114269
Project: 114269
Buggy source:
@Override public void execute(Bundle bundle){
  Exception exception=(Exception)bundle.getSerializable(QBServiceConsts.EXTRA_ERROR);
  int errorCode=bundle.getInt(QBServiceConsts.EXTRA_ERROR_CODE);
  String errorMessage;
  if (exception.getMessage().equals(resources.getString(R.string.error_bad_timestamp))) {
    errorMessage=resources.getString(R.string.error_bad_timestamp_from_app);
    validationUtils.setError(errorMessage);
  }
 else   if (exception.getMessage().equals(resources.getString(R.string.error_email_already_taken)) && startedLoginType.equals(LoginType.FACEBOOK)) {
    errorMessage=resources.getString(R.string.error_email_already_taken_from_app);
    DialogUtils.showLong(LoginActivity.this,errorMessage);
  }
  hideProgress();
}

Fixed version (ground truth):
@Override public void execute(Bundle bundle){
  Exception exception=(Exception)bundle.getSerializable(QBServiceConsts.EXTRA_ERROR);
  int errorCode=bundle.getInt(QBServiceConsts.EXTRA_ERROR_CODE);
  parseExceptionMessage(exception);
}
Program: 114270
Project: 114270
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  updateDialogData();
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(QBServiceConsts.UPDATE_DIALOG)) {
    updateDialogData();
  }
}
Program: 114271
Project: 114271
Buggy source:
@Override public void onAbsolutePathExtFileReceived(String absolutePath){
  imageUtils.showFullImage(context,absolutePath);
}

Fixed version (ground truth):
@Override public void onAbsolutePathExtFileReceived(String absolutePath){
  chatUIHelperListener.onScreenResetPossibilityPerformLogout(false);
  imageUtils.showFullImage((android.app.Activity)context,absolutePath);
}
Program: 114272
Project: 114272
Buggy source:
private void initMaskedImageView(Bitmap loadedBitmap){
  loadedImageBitmap=loadedBitmap;
  viewHolder.attachImageView.setOnClickListener(receiveImageFileOnClickListener());
  viewHolder.attachImageView.setImageBitmap(loadedImageBitmap);
  setViewVisibility(viewHolder.attachMessageRelativeLayout,View.VISIBLE);
  setViewVisibility(viewHolder.attachImageView,View.VISIBLE);
  updateUIAfterLoading();
  scrollMessagesListener.onScrollToBottom();
}

Fixed version (ground truth):
private void initMaskedImageView(Bitmap loadedBitmap){
  loadedImageBitmap=loadedBitmap;
  viewHolder.attachImageView.setOnClickListener(receiveImageFileOnClickListener());
  viewHolder.attachImageView.setImageBitmap(loadedImageBitmap);
  setViewVisibility(viewHolder.attachMessageRelativeLayout,View.VISIBLE);
  setViewVisibility(viewHolder.attachImageView,View.VISIBLE);
  updateUIAfterLoading();
  chatUIHelperListener.onScrollMessagesToBottom();
}
Program: 114273
Project: 114273
Buggy source:
@Override public void onUriScaledBitmapReceived(Uri originalUri){
  hideProgress();
  startCropActivity(originalUri);
}

Fixed version (ground truth):
@Override public void onUriScaledBitmapReceived(Uri originalUri){
  hideProgress();
  canPerformLogout.set(false);
  startCropActivity(originalUri);
}
Program: 114274
Project: 114274
Buggy source:
public GroupDialogMessagesAdapter(Context context,Cursor cursor,ScrollMessagesListener scrollMessagesListener,QBDialog dialog){
  super(context,cursor);
  this.scrollMessagesListener=scrollMessagesListener;
  this.dialog=dialog;
}

Fixed version (ground truth):
public GroupDialogMessagesAdapter(Context context,Cursor cursor,ChatUIHelperListener chatUIHelperListener,QBDialog dialog){
  super(context,cursor);
  this.chatUIHelperListener=chatUIHelperListener;
  this.dialog=dialog;
}
Program: 114275
Project: 114275
Buggy source:
public PrivateDialogMessagesAdapter(Context context,PrivateDialogActivity.FriendOperationListener friendOperationListener,Cursor cursor,ScrollMessagesListener scrollMessagesListener,QBDialog dialog){
  super(context,cursor);
  this.friendOperationListener=friendOperationListener;
  this.scrollMessagesListener=scrollMessagesListener;
  this.dialog=dialog;
}

Fixed version (ground truth):
public PrivateDialogMessagesAdapter(Context context,PrivateDialogActivity.FriendOperationListener friendOperationListener,Cursor cursor,ChatUIHelperListener chatUIHelperListener,QBDialog dialog){
  super(context,cursor);
  this.friendOperationListener=friendOperationListener;
  this.chatUIHelperListener=chatUIHelperListener;
  this.dialog=dialog;
}
Program: 114276
Project: 114276
Buggy source:
public void showFullImage(Context context,String absolutePath){
  Intent intent=new Intent();
  intent.setAction(android.content.Intent.ACTION_VIEW);
  Uri uri=Uri.parse("String_Node_Str" + absolutePath);
  intent.setDataAndType(uri,"String_Node_Str");
  context.startActivity(intent);
}

Fixed version (ground truth):
public void showFullImage(Activity activity,String absolutePath){
  Intent intent=new Intent();
  intent.setAction(android.content.Intent.ACTION_VIEW);
  Uri uri=Uri.parse("String_Node_Str" + absolutePath);
  intent.setDataAndType(uri,"String_Node_Str");
  activity.startActivityForResult(intent,GALLERY_IMAGE_PREVIEWER_CALLED);
}
Program: 114277
Project: 114277
Buggy source:
@Override public Bundle perform(Bundle extras) throws Exception {
  Class<? extends Activity> callClass=(Class<? extends Activity>)extras.getSerializable(QBServiceConsts.EXTRA_CALL_ACTIVITY);
  if (callClass == null) {
    videoChatHelper.init(QBChatService.getInstance());
  }
 else {
    videoChatHelper.initActivityClass(callClass);
  }
  return extras;
}

Fixed version (ground truth):
@Override public Bundle perform(Bundle extras) throws Exception {
  if (extras == null) {
    videoChatHelper.init(QBChatService.getInstance());
  }
 else   if (extras.getSerializable(QBServiceConsts.EXTRA_CALL_ACTIVITY) != null) {
    videoChatHelper.initActivityClass((Class<? extends Activity>)extras.getSerializable(QBServiceConsts.EXTRA_CALL_ACTIVITY));
  }
  return extras;
}
Program: 114278
Project: 114278
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  saveUserAgreementShowing();
  facebookHelper.loginWithFacebook();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  saveUserAgreementShowing();
  loginWithFacebook();
}
Program: 114279
Project: 114279
Buggy source:
public void connectFacebookOnClickListener(View view){
  startedLoginType=LoginType.FACEBOOK;
  if (!isUserAgreementShown()) {
    positiveUserAgreementOnClickListener=new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialog,      int which){
        saveUserAgreementShowing();
        facebookHelper.loginWithFacebook();
      }
    }
;
    showUserAgreement(positiveUserAgreementOnClickListener,negativeUserAgreementOnClickListener);
  }
 else {
    facebookHelper.loginWithFacebook();
  }
}

Fixed version (ground truth):
public void connectFacebookOnClickListener(View view){
  startedLoginType=LoginType.FACEBOOK;
  if (!isUserAgreementShown()) {
    positiveUserAgreementOnClickListener=new DialogInterface.OnClickListener(){
      @Override public void onClick(      DialogInterface dialog,      int which){
        saveUserAgreementShowing();
        loginWithFacebook();
      }
    }
;
    showUserAgreement(positiveUserAgreementOnClickListener,negativeUserAgreementOnClickListener);
  }
 else {
    loginWithFacebook();
  }
}