Program: 14061
Project: 14061
Buggy source:
private void validateAndCreateUserAndBlog(){
  if (mSystemService.getActiveNetworkInfo() == null) {
    AlertUtils.showAlert(getActivity(),R.string.no_network_title,R.string.no_network_message);
    return;
  }
  if (!isUserDataValid()) {
    return;
  }
  if (View.VISIBLE == mProgressBarSignIn.getVisibility()) {
    return;
  }
  startProgress(getString(R.string.validating_user_data));
  final String siteUrl=EditTextUtils.getText(mSiteUrlTextField).trim();
  final String email=EditTextUtils.getText(mEmailTextField).trim();
  mUsername=EditTextUtils.getText(mUsernameTextField).trim();
  mPassword=EditTextUtils.getText(mPasswordTextField).trim();
  final String siteName=siteUrlToSiteName(siteUrl);
  final String language=CreateUserAndBlog.getDeviceLanguage(getActivity());
  CreateUserAndBlog createUserAndBlog=new CreateUserAndBlog(email,mUsername,mPassword,siteUrl,siteName,language,getRestClientUtils(),getActivity(),new ErrorListener(),new CreateUserAndBlog.Callback(){
    @Override public void onStepFinished(    CreateUserAndBlog.Step step){
      if (!isAdded()) {
        return;
      }
switch (step) {
case VALIDATE_USER:
        updateProgress(getString(R.string.validating_site_data));
      break;
case VALIDATE_SITE:
    updateProgress(getString(R.string.creating_your_account));
  break;
case CREATE_USER:
updateProgress(getString(R.string.creating_your_site));
break;
case CREATE_SITE:
case AUTHENTICATE_USER:
default :
break;
}
}
@Override public void onSuccess(JSONObject createSiteResponse){
AnalyticsUtils.refreshMetadata(mUsername,email);
AnalyticsTracker.track(AnalyticsTracker.Stat.CREATED_ACCOUNT);
SmartLockHelper smartLockHelper=getSmartLockHelper();
if (smartLockHelper != null) {
smartLockHelper.saveCredentialsInSmartLock(mUsername,mPassword,mUsername,null);
}
if (isAdded()) {
signInAndFetchBlogListWPCom();
}
}
@Override public void onError(int messageId){
endProgress();
if (isAdded()) {
showError(getString(messageId));
}
}
}
);
AppLog.i(T.NUX,"String_Node_Str" + mUsername + "String_Node_Str"+ email+ "String_Node_Str"+ siteName+ "String_Node_Str"+ siteUrl);
createUserAndBlog.startCreateUserAndBlogProcess();
}

Fixed version (ground truth):
private void validateAndCreateUserAndBlog(){
  if (mSystemService.getActiveNetworkInfo() == null) {
    AlertUtils.showAlert(getActivity(),R.string.no_network_title,R.string.no_network_message);
    return;
  }
  if (!isUserDataValid()) {
    return;
  }
  if (View.VISIBLE == mProgressBarSignIn.getVisibility()) {
    return;
  }
  startProgress(getString(R.string.validating_user_data));
  final String siteUrl=EditTextUtils.getText(mSiteUrlTextField).trim();
  final String email=EditTextUtils.getText(mEmailTextField).trim();
  mUsername=EditTextUtils.getText(mUsernameTextField).trim();
  mPassword=EditTextUtils.getText(mPasswordTextField).trim();
  final String siteName=siteUrlToSiteName(siteUrl);
  final String language=CreateUserAndBlog.getDeviceLanguage(getActivity());
  CreateUserAndBlog createUserAndBlog=new CreateUserAndBlog(email,mUsername,mPassword,siteUrl,siteName,language,getRestClientUtils(),new ErrorListener(),new CreateUserAndBlog.Callback(){
    @Override public void onStepFinished(    CreateUserAndBlog.Step step){
      if (!isAdded()) {
        return;
      }
switch (step) {
case VALIDATE_USER:
        updateProgress(getString(R.string.validating_site_data));
      break;
case VALIDATE_SITE:
    updateProgress(getString(R.string.creating_your_account));
  break;
case CREATE_USER:
updateProgress(getString(R.string.creating_your_site));
break;
case CREATE_SITE:
case AUTHENTICATE_USER:
default :
break;
}
}
@Override public void onSuccess(JSONObject createSiteResponse){
AnalyticsUtils.refreshMetadata(mUsername,email);
AnalyticsTracker.track(AnalyticsTracker.Stat.CREATED_ACCOUNT);
SmartLockHelper smartLockHelper=getSmartLockHelper();
if (smartLockHelper != null) {
smartLockHelper.saveCredentialsInSmartLock(mUsername,mPassword,mUsername,null);
}
if (isAdded()) {
signInAndFetchBlogListWPCom();
}
}
@Override public void onError(int messageId){
endProgress();
if (isAdded()) {
showError(getString(messageId));
}
}
}
);
AppLog.i(T.NUX,"String_Node_Str" + mUsername + "String_Node_Str"+ email+ "String_Node_Str"+ siteName+ "String_Node_Str"+ siteUrl);
createUserAndBlog.startCreateUserAndBlogProcess();
}