[Demonstration 1]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mUserNameView = (AutoCompleteTextView) findViewById(R.id.userNametv);
    mPasswordView = (EditText) findViewById(R.id.password);
    mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
            if (id == R.id.login || id == EditorInfo.IME_NULL) {
                attemptLogin();
                return true;
            }
            return false;
        }
    });
    Button LogInButton = (Button) findViewById(R.id.log_in_button);
    LogInButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            attemptLogin();
        }
    });
    newAccountTV = (TextView) findViewById(R.id.tv_newAccount);
    newAccountTV.setOnClickListener(this);
}

[Buggy Hunk]
mUserNameView = (AutoCompleteTextView) findViewById(R.id.userNametv);

[Patch]
mEmailView = (AutoCompleteTextView) findViewById(R.id.emailtv);

[Demonstration 2]

[Buggy Method]
public void searchActionListener(ActionEvent actionEvent) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    PhaseId phaseId = facesContext.getCurrentPhaseId();
    logger.debug("searchActionListener: phaseId=[{0}]", phaseId.toString());
    String phaseName = phaseId.getName();
    FacesMessage facesMessage = new FacesMessage("The searchActionListener method was called during the " + phaseName + " phase of the JSF lifecycle.");
    facesContext.addMessage(null, facesMessage);
}

[Buggy Hunk]
String phaseName = phaseId.getName();

[Patch]
String phaseName = phaseId.toString();