Program: 141947
Project: 141947
Buggy source:
@Override public void connect(View view,LoginModel model,final Screen host){
  final EditText user=(EditText)view.findViewById(R.id.login_username);
  final EditText pass=(EditText)view.findViewById(R.id.login_password);
  final Button login=(Button)view.findViewById(R.id.login_submit);
  final CheckBox configPass=(CheckBox)view.findViewById(R.id.login_config_save_password);
  final CheckBox configChat=(CheckBox)view.findViewById(R.id.login_config_enter_chat);
  final SettingsContext settings=host.getViewContext().getSettingsContext();
  user.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      String[] passwordHash=settings.get("String_Node_Str","String_Node_Str").split("String_Node_Str");
      if (passwordHash.length == 2 && user.getText().toString().equalsIgnoreCase(passwordHash[0])) {
        pass.setHint("String_Node_Str");
      }
 else {
        pass.setHint("String_Node_Str");
      }
    }
  }
);
  user.setText(settings.get("String_Node_Str","String_Node_Str"));
  String[] passwordHash=settings.get("String_Node_Str","String_Node_Str").split("String_Node_Str");
  savedUser=passwordHash[0];
  savedPass=new PasswordHash(passwordHash[1],true);
  configPass.setChecked(settings.get("String_Node_Str",true));
  configChat.setChecked(settings.get("String_Node_Str",true));
  pass.setOnEditorActionListener(new OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView view,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_GO) {
        login.performClick();
        return true;
      }
      return false;
    }
  }
);
  login.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      String username=user.getText().toString();
      String password=pass.getText().toString();
      PasswordHash pass;
      if (username.equals("String_Node_Str"))       return;
      if (savedUser != null && username.equalsIgnoreCase(savedUser) && (password.equals("String_Node_Str"))) {
        pass=savedPass;
      }
 else {
        if (password.equals("String_Node_Str"))         return;
        pass=new PasswordHash(password,false);
      }
      InputMethodManager inputManager=(InputMethodManager)host.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
      inputManager.hideSoftInputFromWindow(host.getActivity().getCurrentFocus().getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
      getModel().login(username,pass);
      settings.set("String_Node_Str",configPass.isChecked());
      settings.set("String_Node_Str",configChat.isChecked());
      enterChatImmediately=configChat.isChecked();
      if (configPass.isChecked()) {
        settings.set("String_Node_Str",username);
        settings.set("String_Node_Str",username + "String_Node_Str" + pass.getBaseHash());
      }
 else {
        settings.remove("String_Node_Str");
        settings.remove("String_Node_Str");
      }
    }
  }
);
  Button createAccount=(Button)view.findViewById(R.id.login_create_account);
  createAccount.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      getModel().createAccount();
    }
  }
);
  ArrayList<LoginModel.MagicLoginAction> magicActions=model.getMagicCharacters();
  if (magicActions.size() > 0) {
    View panel=view.findViewById(R.id.login_magic_panel);
    panel.setVisibility(View.VISIBLE);
    ViewGroup container=(ViewGroup)view.findViewById(R.id.login_magic_group);
    for (    LoginModel.MagicLoginAction magicAction : magicActions) {
      final LoginModel.MagicLoginAction action=magicAction;
      Button magicButton=new Button(host.getActivity());
      magicButton.setText(action.getCharacter());
      magicButton.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          action.magicLogin();
        }
      }
);
      container.addView(magicButton);
    }
  }
  WebModel announcements=model.getAnnouncementsModel();
  if (announcements == null) {
    View announcementsPanel=view.findViewById(R.id.login_announcements_panel);
    announcementsPanel.setVisibility(View.GONE);
  }
 else {
    Logger.log("String_Node_Str","String_Node_Str");
    ViewScreen announcementsScreen=(ViewScreen)view.findViewById(R.id.login_announcements_screen);
    announcementsScreen.display(new WebController(announcements),host);
  }
}

Fixed version (ground truth):
@Override public void connect(View view,LoginModel model,final Screen host){
  final EditText user=(EditText)view.findViewById(R.id.login_username);
  final EditText pass=(EditText)view.findViewById(R.id.login_password);
  final Button login=(Button)view.findViewById(R.id.login_submit);
  final CheckBox configPass=(CheckBox)view.findViewById(R.id.login_config_save_password);
  final CheckBox configChat=(CheckBox)view.findViewById(R.id.login_config_enter_chat);
  final SettingsContext settings=host.getViewContext().getSettingsContext();
  user.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      String[] passwordHash=settings.get("String_Node_Str","String_Node_Str").split("String_Node_Str");
      if (passwordHash.length == 2 && user.getText().toString().equalsIgnoreCase(passwordHash[0])) {
        pass.setHint("String_Node_Str");
      }
 else {
        pass.setHint("String_Node_Str");
      }
    }
  }
);
  user.setText(settings.get("String_Node_Str","String_Node_Str"));
  String[] passwordHash=settings.get("String_Node_Str","String_Node_Str").split("String_Node_Str");
  savedUser=passwordHash[0];
  savedPass=new PasswordHash(passwordHash[1],true);
  configPass.setChecked(settings.get("String_Node_Str",true));
  configChat.setChecked(settings.get("String_Node_Str",true));
  pass.setOnEditorActionListener(new OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView view,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_GO) {
        login.performClick();
        return true;
      }
      return false;
    }
  }
);
  login.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View arg0){
      String username=user.getText().toString();
      String password=pass.getText().toString();
      PasswordHash pass;
      if (username.equals("String_Node_Str"))       return;
      if (savedUser != null && username.equalsIgnoreCase(savedUser) && (password.equals("String_Node_Str"))) {
        pass=savedPass;
      }
 else {
        if (password.equals("String_Node_Str"))         return;
        pass=new PasswordHash(password,false);
      }
      View focus=host.getActivity().getCurrentFocus();
      if (focus != null) {
        InputMethodManager inputManager=(InputMethodManager)host.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.hideSoftInputFromWindow(focus.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
      }
      getModel().login(username,pass);
      settings.set("String_Node_Str",configPass.isChecked());
      settings.set("String_Node_Str",configChat.isChecked());
      enterChatImmediately=configChat.isChecked();
      if (configPass.isChecked()) {
        settings.set("String_Node_Str",username);
        settings.set("String_Node_Str",username + "String_Node_Str" + pass.getBaseHash());
      }
 else {
        settings.remove("String_Node_Str");
        settings.remove("String_Node_Str");
      }
    }
  }
);
  Button createAccount=(Button)view.findViewById(R.id.login_create_account);
  createAccount.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      getModel().createAccount();
    }
  }
);
  ArrayList<LoginModel.MagicLoginAction> magicActions=model.getMagicCharacters();
  if (magicActions.size() > 0) {
    View panel=view.findViewById(R.id.login_magic_panel);
    panel.setVisibility(View.VISIBLE);
    ViewGroup container=(ViewGroup)view.findViewById(R.id.login_magic_group);
    for (    LoginModel.MagicLoginAction magicAction : magicActions) {
      final LoginModel.MagicLoginAction action=magicAction;
      Button magicButton=new Button(host.getActivity());
      magicButton.setText(action.getCharacter());
      magicButton.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          action.magicLogin();
        }
      }
);
      container.addView(magicButton);
    }
  }
  WebModel announcements=model.getAnnouncementsModel();
  if (announcements == null) {
    View announcementsPanel=view.findViewById(R.id.login_announcements_panel);
    announcementsPanel.setVisibility(View.GONE);
  }
 else {
    Logger.log("String_Node_Str","String_Node_Str");
    ViewScreen announcementsScreen=(ViewScreen)view.findViewById(R.id.login_announcements_screen);
    announcementsScreen.display(new WebController(announcements),host);
  }
}