Program: 116919
Project: 116919
Buggy source:
@Override public void onResume(){
  super.onResume();
  settings=getSharedPreferences(getString(R.string.PREFERENCES_NAME),0);
  editor=settings.edit();
  serverAddressView=(EditText)findViewById(R.id.serverAddressEdit);
  serverAddressView.setText(settings.getString(getString(R.string.PREFERENCES_SERVER_ADDRESS),"String_Node_Str"));
  roomNameView=(Spinner)findViewById(R.id.roomNameSpinner);
  String roomName=settings.getString(getString(R.string.PREFERENCES_ROOM_NAME),"String_Node_Str");
  ArrayAdapter<String> adapter=(ArrayAdapter<String>)roomNameView.getAdapter();
  int spinnerPosition=adapter.getPosition(roomName);
  roomNameView.setSelection(spinnerPosition);
  findViewById(R.id.removeUserDataButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      editor.remove(getString(R.string.PREFERENCES_USERNAME)).remove(getString(R.string.PREFERENCES_PASSWORD));
      Toast.makeText(SettingsActivity.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
);
  Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(getString(R.string.doNotModify));
  builder.setMessage(getString(R.string.onlyItTeamShouldModify));
  builder.setCancelable(false);
  DialogInterface.OnClickListener listener=new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (which == AlertDialog.BUTTON_NEGATIVE) {
        dialog.dismiss();
        finish();
      }
 else {
        dialog.dismiss();
      }
    }
  }
;
  builder.setPositiveButton(getString(R.string.continueBtn),listener);
  builder.setNegativeButton(getString(R.string.goBackBtn),listener);
  builder.show();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  settings=getSharedPreferences(getString(R.string.PREFERENCES_NAME),0);
  editor=settings.edit();
  serverAddressView=(EditText)findViewById(R.id.serverAddressEdit);
  serverAddressView.setText(settings.getString(getString(R.string.PREFERENCES_SERVER_ADDRESS),"String_Node_Str"));
  roomNameView=(Spinner)findViewById(R.id.roomNameSpinner);
  String roomName=settings.getString(getString(R.string.PREFERENCES_ROOM_NAME),"String_Node_Str");
  ArrayAdapter<String> adapter=(ArrayAdapter<String>)roomNameView.getAdapter();
  int spinnerPosition=0;
  if (adapter != null) {
    spinnerPosition=adapter.getPosition(roomName);
  }
  roomNameView.setSelection(spinnerPosition);
  findViewById(R.id.removeUserDataButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      editor.remove(getString(R.string.PREFERENCES_USERNAME)).remove(getString(R.string.PREFERENCES_PASSWORD));
      Toast.makeText(SettingsActivity.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
);
  Builder builder=new AlertDialog.Builder(this);
  builder.setTitle(getString(R.string.doNotModify));
  builder.setMessage(getString(R.string.onlyItTeamShouldModify));
  builder.setCancelable(false);
  DialogInterface.OnClickListener listener=new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (which == AlertDialog.BUTTON_NEGATIVE) {
        dialog.dismiss();
        finish();
      }
 else {
        dialog.dismiss();
      }
    }
  }
;
  builder.setPositiveButton(getString(R.string.continueBtn),listener);
  builder.setNegativeButton(getString(R.string.goBackBtn),listener);
  builder.show();
}