nus-yam/ex-repair huggingface dataset:
Program: 13690
Project: 13690
Buggy source:
@Override protected void setupContent(ViewGroup rootView){
  mEmailInput=rootView.findViewById(R.id.login_email_row);
  if (BuildConfig.DEBUG) {
    mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL);
  }
  mEmailInput.addTextChangedListener(this);
  mEmailInput.setOnEditorCommitListener(this);
  mEmailInput.getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View view,    boolean hasFocus){
      if (hasFocus && !isDisplayingEmailHints && !hasDismissedEmailHints) {
        isDisplayingEmailHints=true;
        getEmailHints();
      }
    }
  }
);
  mEmailInput.getEditText().setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      if (!isDisplayingEmailHints && !hasDismissedEmailHints) {
        isDisplayingEmailHints=true;
        getEmailHints();
      }
    }
  }
);
  LinearLayout googleLoginButton=rootView.findViewById(R.id.login_google_button);
  googleLoginButton.setOnClickListener(new OnClickListener(){
    @SuppressWarnings("String_Node_Str") @Override public void onClick(    View view){
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK);
      EditTextUtils.hideSoftInput(mEmailInput.getEditText());
      if (NetworkUtils.checkConnection(getActivity())) {
        mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
        mIsSocialLogin=true;
        mLoginListener.showGoogleLoginScreen(LoginEmailFragment.this);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void setupContent(ViewGroup rootView){
  mEmailInput=rootView.findViewById(R.id.login_email_row);
  if (BuildConfig.DEBUG) {
    mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL);
  }
  mEmailInput.addTextChangedListener(this);
  mEmailInput.setOnEditorCommitListener(this);
  mEmailInput.getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View view,    boolean hasFocus){
      if (hasFocus && !mIsDisplayingEmailHints && !mHasDismissedEmailHints) {
        mIsDisplayingEmailHints=true;
        getEmailHints();
      }
    }
  }
);
  mEmailInput.getEditText().setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      if (!mIsDisplayingEmailHints && !mHasDismissedEmailHints) {
        mIsDisplayingEmailHints=true;
        getEmailHints();
      }
    }
  }
);
  LinearLayout googleLoginButton=rootView.findViewById(R.id.login_google_button);
  googleLoginButton.setOnClickListener(new OnClickListener(){
    @SuppressWarnings("String_Node_Str") @Override public void onClick(    View view){
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK);
      EditTextUtils.hideSoftInput(mEmailInput.getEditText());
      if (NetworkUtils.checkConnection(getActivity())) {
        mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
        mIsSocialLogin=true;
        mLoginListener.showGoogleLoginScreen(LoginEmailFragment.this);
      }
    }
  }
);
}
Program: 13691
Project: 13691
Buggy source:
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    mOldSitesIDs=savedInstanceState.getIntegerArrayList(KEY_OLD_SITES_IDS);
    mRequestedEmail=savedInstanceState.getString(KEY_REQUESTED_EMAIL);
    mGoogleEmail=savedInstanceState.getString(KEY_GOOGLE_EMAIL);
    mIsSocialLogin=savedInstanceState.getBoolean(KEY_IS_SOCIAL);
    isDisplayingEmailHints=savedInstanceState.getBoolean(KEY_IS_DISPLAYING_EMAIL_HINTS);
    hasDismissedEmailHints=savedInstanceState.getBoolean(KEY_HAS_DISMISSED_EMAIL_HINTS);
  }
 else {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_EMAIL_FORM_VIEWED);
  }
}

Fixed version (ground truth):
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    mOldSitesIDs=savedInstanceState.getIntegerArrayList(KEY_OLD_SITES_IDS);
    mRequestedEmail=savedInstanceState.getString(KEY_REQUESTED_EMAIL);
    mGoogleEmail=savedInstanceState.getString(KEY_GOOGLE_EMAIL);
    mIsSocialLogin=savedInstanceState.getBoolean(KEY_IS_SOCIAL);
    mIsDisplayingEmailHints=savedInstanceState.getBoolean(KEY_IS_DISPLAYING_EMAIL_HINTS);
    mHasDismissedEmailHints=savedInstanceState.getBoolean(KEY_HAS_DISMISSED_EMAIL_HINTS);
  }
 else {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_EMAIL_FORM_VIEWED);
  }
}
Program: 13692
Project: 13692
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_REQUESTED_EMAIL,mRequestedEmail);
  outState.putString(KEY_GOOGLE_EMAIL,mGoogleEmail);
  outState.putBoolean(KEY_IS_SOCIAL,mIsSocialLogin);
  outState.putBoolean(KEY_IS_DISPLAYING_EMAIL_HINTS,isDisplayingEmailHints);
  outState.putBoolean(KEY_HAS_DISMISSED_EMAIL_HINTS,hasDismissedEmailHints);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_REQUESTED_EMAIL,mRequestedEmail);
  outState.putString(KEY_GOOGLE_EMAIL,mGoogleEmail);
  outState.putBoolean(KEY_IS_SOCIAL,mIsSocialLogin);
  outState.putBoolean(KEY_IS_DISPLAYING_EMAIL_HINTS,mIsDisplayingEmailHints);
  outState.putBoolean(KEY_HAS_DISMISSED_EMAIL_HINTS,mHasDismissedEmailHints);
}
Program: 13693
Project: 13693
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginUpdated(OnSitePluginUpdated event){
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.API,"String_Node_Str" + event.error.type);
    refreshPluginVersionViews();
    showUpdateFailedSnackbar();
    return;
  }
  mPlugin=mPluginStore.getSitePluginByName(mSite,mPlugin.getName());
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  refreshViews();
  showSuccessfulUpdateSnackbar();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginUpdated(OnSitePluginUpdated event){
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.API,"String_Node_Str" + event.error.type);
    refreshPluginVersionViews();
    showUpdateFailedSnackbar();
    return;
  }
  String pluginName=mPlugin.getName();
  mPlugin=mPluginStore.getSitePluginByName(mSite,pluginName);
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  refreshViews();
  showSuccessfulUpdateSnackbar();
}
Program: 13694
Project: 13694
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginConfigured(OnSitePluginConfigured event){
  if (event.isError()) {
    ToastUtils.showToast(this,getString(R.string.plugin_configuration_failed,event.error.message));
    if (mIsRemovingPlugin) {
      mIsRemovingPlugin=false;
      cancelRemovePluginProgressDialog();
      showPluginRemoveFailedSnackbar();
    }
    return;
  }
  mPlugin=mPluginStore.getSitePluginByName(mSite,mPlugin.getName());
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  refreshViews();
  if (mIsRemovingPlugin && !mPlugin.isActive()) {
    dispatchRemovePluginAction();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginConfigured(OnSitePluginConfigured event){
  if (event.isError()) {
    ToastUtils.showToast(this,getString(R.string.plugin_configuration_failed,event.error.message));
    if (mIsRemovingPlugin) {
      mIsRemovingPlugin=false;
      cancelRemovePluginProgressDialog();
      showPluginRemoveFailedSnackbar();
    }
    return;
  }
  String pluginName=mPlugin.getName();
  mPlugin=mPluginStore.getSitePluginByName(mSite,pluginName);
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  refreshViews();
  if (mIsRemovingPlugin && !mPlugin.isActive()) {
    dispatchRemovePluginAction();
  }
}
Program: 13696
Project: 13696
Buggy source:
private void updatePluginVersion(){
  if (NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!isUpdateAvailable() || isUpdatingVersion) {
    return;
  }
  UpdateSitePluginVersionPayload payload=new UpdateSitePluginVersionPayload(mSite,mPlugin);
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginVersionAction(payload));
}

Fixed version (ground truth):
private void updatePluginVersion(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!isUpdateAvailable() || isUpdatingVersion) {
    return;
  }
  UpdateSitePluginVersionPayload payload=new UpdateSitePluginVersionPayload(mSite,mPlugin);
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginVersionAction(payload));
}
Program: 13697
Project: 13697
Buggy source:
private void refreshUpdateVersionViews(){
  boolean isUpdateAvailable=!isUpdateAvailable();
  if (isUpdateAvailable && !isUpdatingVersion) {
    mUpdateVersionTextView.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateVersionTextView.setVisibility(View.GONE);
  }
  if (isUpdatingVersion) {
    mUpdateVersionProgressBar.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateVersionProgressBar.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void refreshUpdateVersionViews(){
  boolean isUpdateAvailable=isUpdateAvailable();
  if (isUpdateAvailable && !isUpdatingVersion) {
    mUpdateVersionTextView.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateVersionTextView.setVisibility(View.GONE);
  }
  if (isUpdatingVersion) {
    mUpdateVersionProgressBar.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateVersionProgressBar.setVisibility(View.GONE);
  }
}
Program: 13698
Project: 13698
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAuthenticationChanged(OnAuthenticationChanged event){
  if (event.isError()) {
    endProgress();
    AppLog.e(T.API,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_FAILED,event.getClass().getSimpleName(),event.error.type.toString(),event.error.message);
    if (isSocialLogin) {
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_FAILURE,event.getClass().getSimpleName(),event.error.type.toString(),event.error.message);
    }
    if (isAdded()) {
      handleAuthError(event.error.type,event.error.message);
    }
    return;
  }
  AppLog.i(T.NUX,"String_Node_Str" + event.toString());
  if (isSocialLoginConnect) {
    PushSocialLoginPayload payload=new PushSocialLoginPayload(mIdToken,mService);
    mDispatcher.dispatch(AccountActionBuilder.newPushSocialConnectAction(payload));
  }
 else {
    doFinishLogin();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAuthenticationChanged(OnAuthenticationChanged event){
  if (event.isError()) {
    endProgress();
    AppLog.e(T.API,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_FAILED,event.getClass().getSimpleName(),event.error.type.toString(),event.error.message);
    if (mIsSocialLogin) {
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_FAILURE,event.getClass().getSimpleName(),event.error.type.toString(),event.error.message);
    }
    if (isAdded()) {
      handleAuthError(event.error.type,event.error.message);
    }
    return;
  }
  AppLog.i(T.NUX,"String_Node_Str" + event.toString());
  if (mIsSocialLoginConnect) {
    PushSocialLoginPayload payload=new PushSocialLoginPayload(mIdToken,mService);
    mDispatcher.dispatch(AccountActionBuilder.newPushSocialConnectAction(payload));
  }
 else {
    doFinishLogin();
  }
}
Program: 13699
Project: 13699
Buggy source:
@Override protected void onLoginFinished(){
  mLoginListener.trackAnalyticsSignIn(mAccountStore,mSiteStore,true);
  if (isSocialLogin) {
    mLoginListener.loggedInViaSocialAccount(mOldSitesIDs);
  }
 else {
    mLoginListener.loggedInViaPassword(mOldSitesIDs);
  }
}

Fixed version (ground truth):
@Override protected void onLoginFinished(){
  mLoginListener.trackAnalyticsSignIn(mAccountStore,mSiteStore,true);
  if (mIsSocialLogin) {
    mLoginListener.loggedInViaSocialAccount(mOldSitesIDs);
  }
 else {
    mLoginListener.loggedInViaPassword(mOldSitesIDs);
  }
}
Program: 13700
Project: 13700
Buggy source:
@Override protected void setupBottomButtons(Button secondaryButton,Button primaryButton){
  secondaryButton.setText(R.string.login_text_otp);
  secondaryButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (isAdded()) {
        doAuthAction(R.string.requesting_otp,"String_Node_Str",true);
      }
    }
  }
);
  secondaryButton.setText(getString(sentSmsCode ? R.string.login_text_otp_another : R.string.login_text_otp));
  mSecondaryButton=secondaryButton;
  primaryButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      next();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void setupBottomButtons(Button secondaryButton,Button primaryButton){
  secondaryButton.setText(R.string.login_text_otp);
  secondaryButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (isAdded()) {
        doAuthAction(R.string.requesting_otp,"String_Node_Str",true);
      }
    }
  }
);
  secondaryButton.setText(getString(mSentSmsCode ? R.string.login_text_otp_another : R.string.login_text_otp));
  mSecondaryButton=secondaryButton;
  primaryButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      next();
    }
  }
);
}
Program: 13701
Project: 13701
Buggy source:
@Override protected void setupLabel(@NonNull TextView label){
  label.setText(sentSmsCode ? getString(R.string.enter_verification_code_sms,mPhoneNumber) : getString(R.string.enter_verification_code));
  mLabel=label;
}

Fixed version (ground truth):
@Override protected void setupLabel(@NonNull TextView label){
  label.setText(mSentSmsCode ? getString(R.string.enter_verification_code_sms,mPhoneNumber) : getString(R.string.enter_verification_code));
  mLabel=label;
}
Program: 13702
Project: 13702
Buggy source:
private void setTextForSms(){
  mLabel.setText(getString(R.string.enter_verification_code_sms,mPhoneNumber));
  mSecondaryButton.setText(getString(R.string.login_text_otp_another));
  sentSmsCode=true;
}

Fixed version (ground truth):
private void setTextForSms(){
  mLabel.setText(getString(R.string.enter_verification_code_sms,mPhoneNumber));
  mSecondaryButton.setText(getString(R.string.login_text_otp_another));
  mSentSmsCode=true;
}
Program: 13703
Project: 13703
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSocialChanged(OnSocialChanged event){
  if (event.isError()) {
switch (event.error.type) {
case INVALID_TWO_STEP_CODE:
      endProgress();
switch (mType) {
case TWO_FACTOR_TYPE_AUTHENTICATOR:
      mNonceAuthenticator=event.error.nonce;
    break;
case TWO_FACTOR_TYPE_BACKUP:
  mNonceBackup=event.error.nonce;
break;
case TWO_FACTOR_TYPE_SMS:
mNonceSms=event.error.nonce;
break;
}
show2FaError(getString(R.string.invalid_verification_code));
break;
case INVALID_TWO_STEP_NONCE:
case NO_PHONE_NUMBER_FOR_ACCOUNT:
case SMS_AUTHENTICATION_UNAVAILABLE:
case SMS_CODE_THROTTLED:
endProgress();
showErrorDialog(event.error.message);
AppLog.e(T.API,event.error.type + "String_Node_Str" + event.error.message);
mNonceSms=event.error.nonce;
break;
case UNABLE_CONNECT:
AppLog.e(T.API,"String_Node_Str");
break;
case USER_ALREADY_ASSOCIATED:
AppLog.e(T.API,"String_Node_Str");
break;
}
if (isSocialLoginConnect) {
mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_CONNECT_FAILURE);
doFinishLogin();
}
}
 else if (!TextUtils.isEmpty(event.phoneNumber) && !TextUtils.isEmpty(event.nonce)) {
endProgress();
mPhoneNumber=event.phoneNumber;
mNonceSms=event.nonce;
setTextForSms();
}
 else {
if (isSocialLoginConnect) {
mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_CONNECT_SUCCESS);
}
doFinishLogin();
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSocialChanged(OnSocialChanged event){
  if (event.isError()) {
switch (event.error.type) {
case INVALID_TWO_STEP_CODE:
      endProgress();
switch (mType) {
case TWO_FACTOR_TYPE_AUTHENTICATOR:
      mNonceAuthenticator=event.error.nonce;
    break;
case TWO_FACTOR_TYPE_BACKUP:
  mNonceBackup=event.error.nonce;
break;
case TWO_FACTOR_TYPE_SMS:
mNonceSms=event.error.nonce;
break;
}
show2FaError(getString(R.string.invalid_verification_code));
break;
case INVALID_TWO_STEP_NONCE:
case NO_PHONE_NUMBER_FOR_ACCOUNT:
case SMS_AUTHENTICATION_UNAVAILABLE:
case SMS_CODE_THROTTLED:
endProgress();
showErrorDialog(event.error.message);
AppLog.e(T.API,event.error.type + "String_Node_Str" + event.error.message);
mNonceSms=event.error.nonce;
break;
case UNABLE_CONNECT:
AppLog.e(T.API,"String_Node_Str");
break;
case USER_ALREADY_ASSOCIATED:
AppLog.e(T.API,"String_Node_Str");
break;
}
if (mIsSocialLoginConnect) {
mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_CONNECT_FAILURE);
doFinishLogin();
}
}
 else if (!TextUtils.isEmpty(event.phoneNumber) && !TextUtils.isEmpty(event.nonce)) {
endProgress();
mPhoneNumber=event.phoneNumber;
mNonceSms=event.nonce;
setTextForSms();
}
 else {
if (mIsSocialLoginConnect) {
mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_CONNECT_SUCCESS);
}
doFinishLogin();
}
}
Program: 13704
Project: 13704
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mEmailAddress=getArguments().getString(ARG_EMAIL_ADDRESS);
  mPassword=getArguments().getString(ARG_PASSWORD);
  mNonceAuthenticator=getArguments().getString(ARG_2FA_NONCE_AUTHENTICATOR);
  mNonceBackup=getArguments().getString(ARG_2FA_NONCE_BACKUP);
  mNonceSms=getArguments().getString(ARG_2FA_NONCE_SMS);
  mUserId=getArguments().getString(ARG_2FA_USER_ID);
  mIdToken=getArguments().getString(ARG_2FA_ID_TOKEN);
  isSocialLogin=getArguments().getBoolean(ARG_2FA_IS_SOCIAL);
  isSocialLoginConnect=getArguments().getBoolean(ARG_2FA_IS_SOCIAL_CONNECT);
  mService=getArguments().getString(ARG_2FA_SOCIAL_SERVICE);
  if (savedInstanceState != null) {
    mNonceAuthenticator=savedInstanceState.getString(KEY_NONCE_AUTHENTICATOR);
    mNonceBackup=savedInstanceState.getString(KEY_NONCE_BACKUP);
    mNonceSms=savedInstanceState.getString(KEY_NONCE_SMS);
    mType=savedInstanceState.getString(KEY_2FA_TYPE);
    mPhoneNumber=savedInstanceState.getString(KEY_SMS_NUMBER);
    sentSmsCode=savedInstanceState.getBoolean(KEY_SMS_SENT);
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mEmailAddress=getArguments().getString(ARG_EMAIL_ADDRESS);
  mPassword=getArguments().getString(ARG_PASSWORD);
  mNonceAuthenticator=getArguments().getString(ARG_2FA_NONCE_AUTHENTICATOR);
  mNonceBackup=getArguments().getString(ARG_2FA_NONCE_BACKUP);
  mNonceSms=getArguments().getString(ARG_2FA_NONCE_SMS);
  mUserId=getArguments().getString(ARG_2FA_USER_ID);
  mIdToken=getArguments().getString(ARG_2FA_ID_TOKEN);
  mIsSocialLogin=getArguments().getBoolean(ARG_2FA_IS_SOCIAL);
  mIsSocialLoginConnect=getArguments().getBoolean(ARG_2FA_IS_SOCIAL_CONNECT);
  mService=getArguments().getString(ARG_2FA_SOCIAL_SERVICE);
  if (savedInstanceState != null) {
    mNonceAuthenticator=savedInstanceState.getString(KEY_NONCE_AUTHENTICATOR);
    mNonceBackup=savedInstanceState.getString(KEY_NONCE_BACKUP);
    mNonceSms=savedInstanceState.getString(KEY_NONCE_SMS);
    mType=savedInstanceState.getString(KEY_2FA_TYPE);
    mPhoneNumber=savedInstanceState.getString(KEY_SMS_NUMBER);
    mSentSmsCode=savedInstanceState.getBoolean(KEY_SMS_SENT);
  }
}
Program: 13705
Project: 13705
Buggy source:
private void doAuthAction(@StringRes int messageId,String twoStepCode,boolean shouldSendTwoStepSMS){
  if (!NetworkUtils.checkConnection(getActivity())) {
    return;
  }
  mInProgressMessageId=messageId;
  startProgress();
  mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
  if (isSocialLogin) {
    if (shouldSendTwoStepSMS) {
      PushSocialSmsPayload payload=new PushSocialSmsPayload(mUserId,mNonceSms);
      mDispatcher.dispatch(AccountActionBuilder.newPushSocialSmsAction(payload));
    }
 else {
      setAuthCodeTypeAndNonce(twoStepCode);
      PushSocialAuthPayload payload=new PushSocialAuthPayload(mUserId,mType,mNonce,twoStepCode);
      mDispatcher.dispatch(AccountActionBuilder.newPushSocialAuthAction(payload));
    }
  }
 else {
    AuthenticatePayload payload=new AuthenticatePayload(mEmailAddress,mPassword);
    payload.twoStepCode=twoStepCode;
    payload.shouldSendTwoStepSms=shouldSendTwoStepSMS;
    mDispatcher.dispatch(AuthenticationActionBuilder.newAuthenticateAction(payload));
  }
}

Fixed version (ground truth):
private void doAuthAction(@StringRes int messageId,String twoStepCode,boolean shouldSendTwoStepSMS){
  if (!NetworkUtils.checkConnection(getActivity())) {
    return;
  }
  mInProgressMessageId=messageId;
  startProgress();
  mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
  if (mIsSocialLogin) {
    if (shouldSendTwoStepSMS) {
      PushSocialSmsPayload payload=new PushSocialSmsPayload(mUserId,mNonceSms);
      mDispatcher.dispatch(AccountActionBuilder.newPushSocialSmsAction(payload));
    }
 else {
      setAuthCodeTypeAndNonce(twoStepCode);
      PushSocialAuthPayload payload=new PushSocialAuthPayload(mUserId,mType,mNonce,twoStepCode);
      mDispatcher.dispatch(AccountActionBuilder.newPushSocialAuthAction(payload));
    }
  }
 else {
    AuthenticatePayload payload=new AuthenticatePayload(mEmailAddress,mPassword);
    payload.twoStepCode=twoStepCode;
    payload.shouldSendTwoStepSms=shouldSendTwoStepSMS;
    mDispatcher.dispatch(AuthenticationActionBuilder.newAuthenticateAction(payload));
  }
}
Program: 13706
Project: 13706
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(KEY_IN_PROGRESS_MESSAGE_ID,mInProgressMessageId);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_NONCE_AUTHENTICATOR,mNonceAuthenticator);
  outState.putString(KEY_NONCE_BACKUP,mNonceBackup);
  outState.putString(KEY_NONCE_SMS,mNonceSms);
  outState.putString(KEY_2FA_TYPE,mType);
  outState.putString(KEY_SMS_NUMBER,mPhoneNumber);
  outState.putBoolean(KEY_SMS_SENT,sentSmsCode);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(KEY_IN_PROGRESS_MESSAGE_ID,mInProgressMessageId);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_NONCE_AUTHENTICATOR,mNonceAuthenticator);
  outState.putString(KEY_NONCE_BACKUP,mNonceBackup);
  outState.putString(KEY_NONCE_SMS,mNonceSms);
  outState.putString(KEY_2FA_TYPE,mType);
  outState.putString(KEY_SMS_NUMBER,mPhoneNumber);
  outState.putBoolean(KEY_SMS_SENT,mSentSmsCode);
}
Program: 13707
Project: 13707
Buggy source:
@Override protected @LayoutRes int getProgressBarText(){
  return isSocialLogin ? R.string.logging_in : R.string.checking_email;
}

Fixed version (ground truth):
@Override protected @LayoutRes int getProgressBarText(){
  return mIsSocialLogin ? R.string.logging_in : R.string.checking_email;
}
Program: 13708
Project: 13708
Buggy source:
@Override protected void onHelp(){
  if (mLoginListener != null) {
    if (isSocialLogin) {
      mLoginListener.helpSocialEmailScreen(mGoogleEmail);
    }
 else {
      mLoginListener.helpEmailScreen(EditTextUtils.getText(mEmailInput.getEditText()));
    }
  }
}

Fixed version (ground truth):
@Override protected void onHelp(){
  if (mLoginListener != null) {
    if (mIsSocialLogin) {
      mLoginListener.helpSocialEmailScreen(mGoogleEmail);
    }
 else {
      mLoginListener.helpEmailScreen(EditTextUtils.getText(mEmailInput.getEditText()));
    }
  }
}
Program: 13709
Project: 13709
Buggy source:
@Override public void onTextChanged(CharSequence s,int start,int before,int count){
  mEmailInput.setError(null);
  isSocialLogin=false;
}

Fixed version (ground truth):
@Override public void onTextChanged(CharSequence s,int start,int before,int count){
  mEmailInput.setError(null);
  mIsSocialLogin=false;
}
Program: 13710
Project: 13710
Buggy source:
@Override protected void setupContent(ViewGroup rootView){
  mEmailInput=rootView.findViewById(R.id.login_email_row);
  if (BuildConfig.DEBUG) {
    mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL);
  }
  mEmailInput.addTextChangedListener(this);
  mEmailInput.setOnEditorCommitListener(this);
  LinearLayout googleLoginButton=rootView.findViewById(R.id.login_google_button);
  googleLoginButton.setOnClickListener(new OnClickListener(){
    @SuppressWarnings("String_Node_Str") @Override public void onClick(    View view){
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK);
      ActivityUtils.hideKeyboard(getActivity().getCurrentFocus());
      if (NetworkUtils.checkConnection(getActivity())) {
        mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
        isSocialLogin=true;
        mLoginListener.showGoogleLoginScreen(LoginEmailFragment.this);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void setupContent(ViewGroup rootView){
  mEmailInput=rootView.findViewById(R.id.login_email_row);
  if (BuildConfig.DEBUG) {
    mEmailInput.getEditText().setText(BuildConfig.DEBUG_WPCOM_LOGIN_EMAIL);
  }
  mEmailInput.addTextChangedListener(this);
  mEmailInput.setOnEditorCommitListener(this);
  LinearLayout googleLoginButton=rootView.findViewById(R.id.login_google_button);
  googleLoginButton.setOnClickListener(new OnClickListener(){
    @SuppressWarnings("String_Node_Str") @Override public void onClick(    View view){
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK);
      ActivityUtils.hideKeyboard(getActivity().getCurrentFocus());
      if (NetworkUtils.checkConnection(getActivity())) {
        mOldSitesIDs=SiteUtils.getCurrentSiteIds(mSiteStore,false);
        mIsSocialLogin=true;
        mLoginListener.showGoogleLoginScreen(LoginEmailFragment.this);
      }
    }
  }
);
}
Program: 13711
Project: 13711
Buggy source:
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    mOldSitesIDs=savedInstanceState.getIntegerArrayList(KEY_OLD_SITES_IDS);
    mRequestedEmail=savedInstanceState.getString(KEY_REQUESTED_EMAIL);
    mGoogleEmail=savedInstanceState.getString(KEY_GOOGLE_EMAIL);
    isSocialLogin=savedInstanceState.getBoolean(KEY_IS_SOCIAL);
  }
 else {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_EMAIL_FORM_VIEWED);
  }
}

Fixed version (ground truth):
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    mOldSitesIDs=savedInstanceState.getIntegerArrayList(KEY_OLD_SITES_IDS);
    mRequestedEmail=savedInstanceState.getString(KEY_REQUESTED_EMAIL);
    mGoogleEmail=savedInstanceState.getString(KEY_GOOGLE_EMAIL);
    mIsSocialLogin=savedInstanceState.getBoolean(KEY_IS_SOCIAL);
  }
 else {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_EMAIL_FORM_VIEWED);
  }
}
Program: 13712
Project: 13712
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_REQUESTED_EMAIL,mRequestedEmail);
  outState.putString(KEY_GOOGLE_EMAIL,mGoogleEmail);
  outState.putBoolean(KEY_IS_SOCIAL,isSocialLogin);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
  outState.putString(KEY_REQUESTED_EMAIL,mRequestedEmail);
  outState.putString(KEY_GOOGLE_EMAIL,mGoogleEmail);
  outState.putBoolean(KEY_IS_SOCIAL,mIsSocialLogin);
}
Program: 13713
Project: 13713
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mEmailAddress=getArguments().getString(ARG_EMAIL_ADDRESS);
  mPassword=getArguments().getString(ARG_PASSWORD);
  mIdToken=getArguments().getString(ARG_SOCIAL_ID_TOKEN);
  mService=getArguments().getString(ARG_SOCIAL_SERVICE);
  isSocialLogin=getArguments().getBoolean(ARG_SOCIAL_LOGIN);
  if (savedInstanceState != null) {
    mRequestedPassword=savedInstanceState.getString(KEY_REQUESTED_PASSWORD);
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mEmailAddress=getArguments().getString(ARG_EMAIL_ADDRESS);
  mPassword=getArguments().getString(ARG_PASSWORD);
  mIdToken=getArguments().getString(ARG_SOCIAL_ID_TOKEN);
  mService=getArguments().getString(ARG_SOCIAL_SERVICE);
  mIsSocialLogin=getArguments().getBoolean(ARG_SOCIAL_LOGIN);
  if (savedInstanceState != null) {
    mRequestedPassword=savedInstanceState.getString(KEY_REQUESTED_PASSWORD);
  }
}
Program: 13714
Project: 13714
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAuthenticationChanged(OnAuthenticationChanged event){
  if (event.isError()) {
    endProgress();
    AppLog.e(T.API,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    if (isAdded()) {
      handleAuthError(event.error.type,event.error.message);
    }
    return;
  }
  AppLog.i(T.NUX,"String_Node_Str" + event.toString());
  if (isSocialLogin) {
    PushSocialLoginPayload payload=new PushSocialLoginPayload(mIdToken,mService);
    mDispatcher.dispatch(AccountActionBuilder.newPushSocialConnectAction(payload));
  }
 else {
    saveCredentialsInSmartLock(mLoginListener,mEmailAddress,mRequestedPassword);
    doFinishLogin();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAuthenticationChanged(OnAuthenticationChanged event){
  if (event.isError()) {
    endProgress();
    AppLog.e(T.API,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    if (isAdded()) {
      handleAuthError(event.error.type,event.error.message);
    }
    return;
  }
  AppLog.i(T.NUX,"String_Node_Str" + event.toString());
  if (mIsSocialLogin) {
    PushSocialLoginPayload payload=new PushSocialLoginPayload(mIdToken,mService);
    mDispatcher.dispatch(AccountActionBuilder.newPushSocialConnectAction(payload));
  }
 else {
    saveCredentialsInSmartLock(mLoginListener,mEmailAddress,mRequestedPassword);
    doFinishLogin();
  }
}
Program: 13715
Project: 13715
Buggy source:
@Override protected void onLoginFinished(){
  mLoginListener.trackAnalyticsSignIn(mAccountStore,mSiteStore,true);
  if (isSocialLogin) {
    mLoginListener.loggedInViaSocialAccount(mOldSitesIDs);
  }
 else {
    mLoginListener.loggedInViaPassword(mOldSitesIDs);
  }
}

Fixed version (ground truth):
@Override protected void onLoginFinished(){
  mLoginListener.trackAnalyticsSignIn(mAccountStore,mSiteStore,true);
  if (mIsSocialLogin) {
    mLoginListener.loggedInViaSocialAccount(mOldSitesIDs);
  }
 else {
    mLoginListener.loggedInViaPassword(mOldSitesIDs);
  }
}
Program: 13716
Project: 13716
Buggy source:
@Override protected void setupLabel(@NonNull TextView label){
  label.setText(isSocialLogin ? R.string.enter_wpcom_password_google : R.string.enter_wpcom_password);
}

Fixed version (ground truth):
@Override protected void setupLabel(@NonNull TextView label){
  label.setText(mIsSocialLogin ? R.string.enter_wpcom_password_google : R.string.enter_wpcom_password);
}
Program: 13717
Project: 13717
Buggy source:
private void handleAuthError(AccountStore.AuthenticationErrorType error,String errorMessage){
  if (error != AccountStore.AuthenticationErrorType.NEEDS_2FA) {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_FAILED,error.getClass().getSimpleName(),error.toString(),errorMessage);
    if (isSocialLogin) {
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_FAILURE,error.getClass().getSimpleName(),error.toString(),errorMessage);
    }
  }
switch (error) {
case INCORRECT_USERNAME_OR_PASSWORD:
case NOT_AUTHENTICATED:
    showPasswordError();
  break;
case NEEDS_2FA:
saveCredentialsInSmartLock(mLoginListener,mEmailAddress,mPassword);
if (isSocialLogin) {
mLoginListener.needs2faSocialConnect(mEmailAddress,mRequestedPassword,mIdToken,mService);
}
 else {
mLoginListener.needs2fa(mEmailAddress,mRequestedPassword);
}
break;
case INVALID_REQUEST:
default :
AppLog.e(T.NUX,"String_Node_Str" + errorMessage);
ToastUtils.showToast(getActivity(),errorMessage == null ? getString(R.string.error_generic) : errorMessage);
break;
}
}

Fixed version (ground truth):
private void handleAuthError(AccountStore.AuthenticationErrorType error,String errorMessage){
  if (error != AccountStore.AuthenticationErrorType.NEEDS_2FA) {
    mLoginListener.track(AnalyticsTracker.Stat.LOGIN_FAILED,error.getClass().getSimpleName(),error.toString(),errorMessage);
    if (mIsSocialLogin) {
      mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_FAILURE,error.getClass().getSimpleName(),error.toString(),errorMessage);
    }
  }
switch (error) {
case INCORRECT_USERNAME_OR_PASSWORD:
case NOT_AUTHENTICATED:
    showPasswordError();
  break;
case NEEDS_2FA:
saveCredentialsInSmartLock(mLoginListener,mEmailAddress,mPassword);
if (mIsSocialLogin) {
mLoginListener.needs2faSocialConnect(mEmailAddress,mRequestedPassword,mIdToken,mService);
}
 else {
mLoginListener.needs2fa(mEmailAddress,mRequestedPassword);
}
break;
case INVALID_REQUEST:
default :
AppLog.e(T.NUX,"String_Node_Str" + errorMessage);
ToastUtils.showToast(getActivity(),errorMessage == null ? getString(R.string.error_generic) : errorMessage);
break;
}
}
Program: 13718
Project: 13718
Buggy source:
@Override public void onResponse(JSONObject response){
  ThemeTable.setCurrentTheme(WordPress.wpDB.getDatabase(),String.valueOf(site.getSiteId()),themeId);
  setState(SiteCreationPhase.SUCCESS);
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject response){
  mThemeStore.setActiveThemeForSite(site,themeModel);
  setState(SiteCreationPhase.SUCCESS);
}
Program: 13719
Project: 13719
Buggy source:
private void activateTheme(final SiteModel site,final String themeId){
  WordPress.getRestClientUtils().setTheme(site.getSiteId(),themeId,new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject response){
      ThemeTable.setCurrentTheme(WordPress.wpDB.getDatabase(),String.valueOf(site.getSiteId()),themeId);
      setState(SiteCreationPhase.SUCCESS);
    }
  }
,new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      setState(SiteCreationPhase.FAILURE);
    }
  }
);
}

Fixed version (ground truth):
private void activateTheme(final SiteModel site,final ThemeModel themeModel){
  WordPress.getRestClientUtils().setTheme(site.getSiteId(),themeModel.getThemeId(),new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject response){
      mThemeStore.setActiveThemeForSite(site,themeModel);
      setState(SiteCreationPhase.SUCCESS);
    }
  }
,new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      setState(SiteCreationPhase.FAILURE);
    }
  }
);
}
Program: 13720
Project: 13720
Buggy source:
@Override public int onStartCommand(@Nullable Intent intent,int flags,int startId){
  if (intent == null) {
    return START_NOT_STICKY;
  }
  setState(SiteCreationPhase.NEW_SITE);
  final String siteTitle=intent.getStringExtra(ARG_SITE_TITLE);
  final String siteSlug=intent.getStringExtra(ARG_SITE_SLUG);
  mSiteTagline=intent.getStringExtra(ARG_SITE_TAGLINE);
  mSiteTheme=intent.getStringExtra(ARG_SITE_THEME);
  final String language=LanguageUtils.getPatchedCurrentDeviceLanguage(this);
  SiteStore.NewSitePayload newSitePayload=new SiteStore.NewSitePayload(siteSlug,siteTitle,language,SiteStore.SiteVisibility.PUBLIC,false);
  mDispatcher.dispatch(SiteActionBuilder.newCreateNewSiteAction(newSitePayload));
  AppLog.i(T.NUX,"String_Node_Str" + siteTitle + "String_Node_Str"+ siteSlug);
  return START_REDELIVER_INTENT;
}

Fixed version (ground truth):
@Override public int onStartCommand(@Nullable Intent intent,int flags,int startId){
  if (intent == null) {
    return START_NOT_STICKY;
  }
  setState(SiteCreationPhase.NEW_SITE);
  final String siteTitle=intent.getStringExtra(ARG_SITE_TITLE);
  final String siteSlug=intent.getStringExtra(ARG_SITE_SLUG);
  mSiteTagline=intent.getStringExtra(ARG_SITE_TAGLINE);
  String themeId=intent.getStringExtra(ARG_SITE_THEME_ID);
  mSiteTheme=mThemeStore.getWpComThemeByThemeId(themeId);
  final String language=LanguageUtils.getPatchedCurrentDeviceLanguage(this);
  SiteStore.NewSitePayload newSitePayload=new SiteStore.NewSitePayload(siteSlug,siteTitle,language,SiteStore.SiteVisibility.PUBLIC,false);
  mDispatcher.dispatch(SiteActionBuilder.newCreateNewSiteAction(newSitePayload));
  AppLog.i(T.NUX,"String_Node_Str" + siteTitle + "String_Node_Str"+ siteSlug);
  return START_REDELIVER_INTENT;
}
Program: 13721
Project: 13721
Buggy source:
public static void createSite(Context context,String siteTitle,String siteTagline,String siteSlug,String siteTheme){
  Intent intent=new Intent(context,SiteCreationService.class);
  intent.putExtra(ARG_SITE_TITLE,siteTitle);
  intent.putExtra(ARG_SITE_TAGLINE,siteTagline);
  intent.putExtra(ARG_SITE_SLUG,siteSlug);
  intent.putExtra(ARG_SITE_THEME,siteTheme);
  context.startService(intent);
}

Fixed version (ground truth):
public static void createSite(Context context,String siteTitle,String siteTagline,String siteSlug,String siteThemeId){
  Intent intent=new Intent(context,SiteCreationService.class);
  intent.putExtra(ARG_SITE_TITLE,siteTitle);
  intent.putExtra(ARG_SITE_TAGLINE,siteTagline);
  intent.putExtra(ARG_SITE_SLUG,siteSlug);
  intent.putExtra(ARG_SITE_THEME_ID,siteThemeId);
  context.startService(intent);
}
Program: 13722
Project: 13722
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ((WordPress)getApplication()).component().inject(this);
  mDispatcher.register(this);
  setContentView(R.layout.plugin_detail_activity);
  String pluginName;
  if (savedInstanceState == null) {
    mSite=(SiteModel)getIntent().getSerializableExtra(WordPress.SITE);
    pluginName=getIntent().getStringExtra(KEY_PLUGIN_NAME);
  }
 else {
    mSite=(SiteModel)savedInstanceState.getSerializable(WordPress.SITE);
    pluginName=savedInstanceState.getString(KEY_PLUGIN_NAME);
  }
  mPlugin=mPluginStore.getPluginByName(mSite,pluginName);
  if (mSite == null) {
    ToastUtils.showToast(this,R.string.blog_not_found,Duration.SHORT);
    finish();
    return;
  }
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  Toolbar toolbar=findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setElevation(0);
  }
  setupViews();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ((WordPress)getApplication()).component().inject(this);
  mDispatcher.register(this);
  setContentView(R.layout.plugin_detail_activity);
  String pluginName;
  if (savedInstanceState == null) {
    mSite=(SiteModel)getIntent().getSerializableExtra(WordPress.SITE);
    pluginName=getIntent().getStringExtra(KEY_PLUGIN_NAME);
  }
 else {
    mSite=(SiteModel)savedInstanceState.getSerializable(WordPress.SITE);
    pluginName=savedInstanceState.getString(KEY_PLUGIN_NAME);
  }
  mPlugin=mPluginStore.getSitePluginByName(mSite,pluginName);
  if (mSite == null) {
    ToastUtils.showToast(this,R.string.blog_not_found,Duration.SHORT);
    finish();
    return;
  }
  if (mPlugin == null) {
    ToastUtils.showToast(this,R.string.plugin_not_found,Duration.SHORT);
    finish();
    return;
  }
  Toolbar toolbar=findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setElevation(0);
  }
  setupViews();
}
Program: 13723
Project: 13723
Buggy source:
private void dispatchUpdateAction(){
  mDispatcher.dispatch(PluginActionBuilder.newUpdatePluginAction(new UpdatePluginPayload(mSite,mPlugin)));
}

Fixed version (ground truth):
private void dispatchUpdateAction(){
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginAction(new UpdateSitePluginPayload(mSite,mPlugin)));
}
Program: 13724
Project: 13724
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginChanged(OnPluginChanged event){
  if (event.isError()) {
    return;
  }
  refreshPluginList();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginChanged(OnSitePluginUpdated event){
  if (event.isError()) {
    return;
  }
  refreshPluginList();
}
Program: 13726
Project: 13726
Buggy source:
private void verifyMediaOnlyUploadsAndNotify(){
  if (!mMediaBatchUploaded.isEmpty()) {
    ArrayList<MediaModel> standAloneMediaItems=new ArrayList<>();
    for (    MediaModel media : mMediaBatchUploaded) {
      MediaModel currentMedia=mMediaStore.getMediaWithLocalId(media.getId());
      if (currentMedia.getLocalPostId() == 0) {
        standAloneMediaItems.add(currentMedia);
      }
    }
    if (!standAloneMediaItems.isEmpty()) {
      SiteModel site=mSiteStore.getSiteByLocalId(standAloneMediaItems.get(0).getLocalSiteId());
      mPostUploadNotifier.updateNotificationSuccessForMedia(standAloneMediaItems,site);
      mMediaBatchUploaded.clear();
    }
  }
}

Fixed version (ground truth):
private void verifyMediaOnlyUploadsAndNotify(){
  if (!mMediaBatchUploaded.isEmpty()) {
    ArrayList<MediaModel> standAloneMediaItems=new ArrayList<>();
    for (    MediaModel media : mMediaBatchUploaded) {
      MediaModel currentMedia=mMediaStore.getMediaWithLocalId(media.getId());
      if (currentMedia.getLocalPostId() == 0 && MediaUploadState.fromString(currentMedia.getUploadState()) == MediaUploadState.UPLOADED) {
        standAloneMediaItems.add(currentMedia);
      }
    }
    if (!standAloneMediaItems.isEmpty()) {
      SiteModel site=mSiteStore.getSiteByLocalId(standAloneMediaItems.get(0).getLocalSiteId());
      mPostUploadNotifier.updateNotificationSuccessForMedia(standAloneMediaItems,site);
      mMediaBatchUploaded.clear();
    }
  }
}
Program: 13727
Project: 13727
Buggy source:
@Override protected Boolean doInBackground(Void... nada){
  if (mIsPage) {
    tmpPosts=mPostStore.getPagesForSite(mSite);
  }
 else {
    tmpPosts=mPostStore.getPostsForSite(mSite);
  }
  for (  PostModel hiddenPost : mHiddenPosts) {
    tmpPosts.remove(hiddenPost);
  }
  if (mLoadMode == LoadMode.IF_CHANGED && PostUtils.postListsAreEqual(mPosts,tmpPosts)) {
    boolean postsAreUploading=false;
    for (    PostModel post : tmpPosts) {
      if (UploadService.isPostUploadingOrQueued(post)) {
        postsAreUploading=true;
        break;
      }
    }
    if (!postsAreUploading) {
      return false;
    }
  }
  mFeaturedImageUrls.clear();
  boolean isPrivate=!SiteUtils.isPhotonCapable(mSite);
  for (  PostModel post : tmpPosts) {
    String imageUrl=null;
    if (post.getFeaturedImageId() != 0) {
      MediaModel media=mMediaStore.getSiteMediaWithId(mSite,post.getFeaturedImageId());
      if (media != null) {
        imageUrl=media.getUrl();
      }
 else {
        mediaIdsToUpdate.add(post.getFeaturedImageId());
      }
    }
 else {
      imageUrl=new ReaderImageScanner(post.getContent(),isPrivate).getLargestImage();
    }
    if (!TextUtils.isEmpty(imageUrl)) {
      mFeaturedImageUrls.put(post.getId(),imageUrl);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected Boolean doInBackground(Void... nada){
  if (mIsPage) {
    tmpPosts=mPostStore.getPagesForSite(mSite);
  }
 else {
    tmpPosts=mPostStore.getPostsForSite(mSite);
  }
  tmpPosts.removeAll(mHiddenPosts);
  if (mLoadMode == LoadMode.IF_CHANGED && PostUtils.postListsAreEqual(mPosts,tmpPosts)) {
    boolean postsAreUploading=false;
    for (    PostModel post : tmpPosts) {
      if (UploadService.isPostUploadingOrQueued(post)) {
        postsAreUploading=true;
        break;
      }
    }
    if (!postsAreUploading) {
      return false;
    }
  }
  mFeaturedImageUrls.clear();
  boolean isPrivate=!SiteUtils.isPhotonCapable(mSite);
  for (  PostModel post : tmpPosts) {
    String imageUrl=null;
    if (post.getFeaturedImageId() != 0) {
      MediaModel media=mMediaStore.getSiteMediaWithId(mSite,post.getFeaturedImageId());
      if (media != null) {
        imageUrl=media.getUrl();
      }
 else {
        mediaIdsToUpdate.add(post.getFeaturedImageId());
      }
    }
 else {
      imageUrl=new ReaderImageScanner(post.getContent(),isPrivate).getLargestImage();
    }
    if (!TextUtils.isEmpty(imageUrl)) {
      mFeaturedImageUrls.put(post.getId(),imageUrl);
    }
  }
  return true;
}
Program: 13728
Project: 13728
Buggy source:
/** 
 * Get the URL of the WordPress login page.
 * @return URL of the login page.
 */
public static String getSiteLoginUrl(SiteModel site){
  String loginURL=site.getLoginUrl();
  if (loginURL == null) {
    if (site.getUrl() != null) {
      return site.getUrl() + "String_Node_Str";
    }
 else {
      return site.getXmlRpcUrl().replace("String_Node_Str","String_Node_Str");
    }
  }
  return loginURL;
}

Fixed version (ground truth):
/** 
 * Get the URL of the WordPress login page.
 * @return URL of the login page.
 */
public static String getSiteLoginUrl(SiteModel site){
  if (site.isJetpackConnected()) {
    return WPCOM_LOGIN_URL;
  }
  String loginURL=site.getLoginUrl();
  if (loginURL == null) {
    if (site.getUrl() != null) {
      return site.getUrl() + "String_Node_Str";
    }
 else {
      return site.getXmlRpcUrl().replace("String_Node_Str","String_Node_Str");
    }
  }
  return loginURL;
}
Program: 13729
Project: 13729
Buggy source:
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
    UploadUtils.onMediaUploadedSnackbarHandler(getActivity(),getActivity().findViewById(R.id.coordinator),true,event.mediaModelList,event.successMessage);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
    UploadUtils.onMediaUploadedSnackbarHandler(getActivity(),getActivity().findViewById(R.id.coordinator),false,event.mediaModelList,event.successMessage);
  }
}
Program: 13730
Project: 13730
Buggy source:
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
    UploadUtils.onMediaUploadedSnackbarHandler(this,findViewById(R.id.tab_layout),true,event.mediaModelList,event.successMessage);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
    UploadUtils.onMediaUploadedSnackbarHandler(this,findViewById(R.id.tab_layout),false,event.mediaModelList,event.successMessage);
  }
}