Program: 63776
Project: 63776
Buggy source:
private void loginUser(){
  Log.v("String_Node_Str","String_Node_Str");
  String serverURL=createServerURL((mSelfHostedURL) ? edtSelfHosted.getText().toString() : OConstants.URL_ODOO);
  String databaseName;
  edtUsername=(EditText)findViewById(R.id.edtUserName);
  edtPassword=(EditText)findViewById(R.id.edtPassword);
  if (mSelfHostedURL) {
    edtSelfHosted.setError(null);
    if (TextUtils.isEmpty(edtSelfHosted.getText())) {
      edtSelfHosted.setError(OResource.string(this,R.string.error_provide_server_url));
      edtSelfHosted.requestFocus();
      return;
    }
    if (databaseSpinner != null && databases.size() > 1 && databaseSpinner.getSelectedItemPosition() == 0) {
      Toast.makeText(this,OResource.string(this,R.string.label_select_database),Toast.LENGTH_LONG).show();
      return;
    }
  }
  edtUsername.setError(null);
  edtPassword.setError(null);
  if (TextUtils.isEmpty(edtUsername.getText())) {
    edtUsername.setError(OResource.string(this,R.string.error_provide_username));
    edtUsername.requestFocus();
    return;
  }
  if (TextUtils.isEmpty(edtPassword.getText())) {
    edtPassword.setError(OResource.string(this,R.string.error_provide_password));
    edtPassword.requestFocus();
    return;
  }
  findViewById(R.id.controls).setVisibility(View.GONE);
  findViewById(R.id.login_progress).setVisibility(View.VISIBLE);
  mLoginProcessStatus.setText(OResource.string(OdooLogin.this,R.string.status_connecting_to_server));
  if (mConnectedToServer) {
    databaseName=databases.get(0);
    if (databaseSpinner != null) {
      databaseName=databases.get(databaseSpinner.getSelectedItemPosition());
    }
    mAutoLogin=false;
    loginProcess(null,serverURL,databaseName);
  }
 else {
    mAutoLogin=true;
    Log.v("String_Node_Str","String_Node_Str" + serverURL);
    Odoo.createInstance(OdooLogin.this,serverURL).setOnConnect(OdooLogin.this);
  }
}

Fixed version (ground truth):
private void loginUser(){
  Log.v("String_Node_Str","String_Node_Str");
  String serverURL=createServerURL((mSelfHostedURL) ? edtSelfHosted.getText().toString() : OConstants.URL_ODOO);
  String databaseName;
  edtUsername=(EditText)findViewById(R.id.edtUserName);
  edtPassword=(EditText)findViewById(R.id.edtPassword);
  if (mSelfHostedURL) {
    edtSelfHosted.setError(null);
    if (TextUtils.isEmpty(edtSelfHosted.getText())) {
      edtSelfHosted.setError(OResource.string(this,R.string.error_provide_server_url));
      edtSelfHosted.requestFocus();
      return;
    }
    if (databaseSpinner != null && databases.size() > 1 && databaseSpinner.getSelectedItemPosition() == 0) {
      Toast.makeText(this,OResource.string(this,R.string.label_select_database),Toast.LENGTH_LONG).show();
      return;
    }
  }
  edtUsername.setError(null);
  edtPassword.setError(null);
  if (TextUtils.isEmpty(edtUsername.getText())) {
    edtUsername.setError(OResource.string(this,R.string.error_provide_username));
    edtUsername.requestFocus();
    return;
  }
  if (TextUtils.isEmpty(edtPassword.getText())) {
    edtPassword.setError(OResource.string(this,R.string.error_provide_password));
    edtPassword.requestFocus();
    return;
  }
  findViewById(R.id.controls).setVisibility(View.GONE);
  findViewById(R.id.login_progress).setVisibility(View.VISIBLE);
  mLoginProcessStatus.setText(OResource.string(OdooLogin.this,R.string.status_connecting_to_server));
  if (mConnectedToServer) {
    databaseName=databases.get(0);
    if (databaseSpinner != null) {
      databaseName=databases.get(databaseSpinner.getSelectedItemPosition());
    }
    mAutoLogin=false;
    loginProcess(null,serverURL,databaseName);
  }
 else {
    mAutoLogin=true;
    Log.v("String_Node_Str","String_Node_Str" + serverURL);
    try {
      Odoo.createInstance(OdooLogin.this,serverURL).setOnConnect(OdooLogin.this);
    }
 catch (    OdooVersionException e) {
      e.printStackTrace();
    }
  }
}