[Demonstration 1]

[Buggy Method]
@Override
public void onClick(View v) {
    mWakeLock.acquire();
    String password = mPasswordView.getText().toString();
    String wpsNfcConfigurationToken = mWifiManager.getWpsNfcConfigurationToken(mAccessPoint.networkId);
    String passwordHex = byteArrayToHexString(password.getBytes());
    String passwordLength = password.length() >= HEX_RADIX ? "" + Character.forDigit(password.length(), HEX_RADIX) : "0" + Character.forDigit(password.length(), HEX_RADIX);
    passwordHex = String.format(PASSWORD_FORMAT, passwordLength, passwordHex).toUpperCase();
    if (wpsNfcConfigurationToken.contains(passwordHex)) {
        mWpsNfcConfigurationToken = wpsNfcConfigurationToken;
        Activity activity = getOwnerActivity();
        NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(activity);
        nfcAdapter.enableReaderMode(activity, new NfcAdapter.ReaderCallback() {

            @Override
            public void onTagDiscovered(Tag tag) {
                handleWriteNfcEvent(tag);
            }
        }, NfcAdapter.FLAG_READER_NFC_A | NfcAdapter.FLAG_READER_NFC_B | NfcAdapter.FLAG_READER_NFC_BARCODE | NfcAdapter.FLAG_READER_NFC_F | NfcAdapter.FLAG_READER_NFC_V, null);
        mPasswordView.setVisibility(View.GONE);
        mPasswordCheckBox.setVisibility(View.GONE);
        mSubmitButton.setVisibility(View.GONE);
        InputMethodManager imm = (InputMethodManager) getOwnerActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(mPasswordView.getWindowToken(), 0);
        mLabelView.setText(R.string.status_awaiting_tap);
        mView.findViewById(R.id.password_layout).setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
        mProgressBar.setVisibility(View.VISIBLE);
    } else {
        mLabelView.setText(R.string.status_invalid_password);
    }
}

[Buggy Hunk]
? "" + Character.forDigit(password.length(), HEX_RADIX)

[Patch]
? Integer.toString(password.length(), HEX_RADIX)

[Demonstration 2]

[Buggy Method]
private void shutdown() {
    try {
        if (_cbBluetooth.isEnabled() && _cbBluetooth.isChecked()) {
            _BluetoothAdapter.disable();
        }
        if (_cbWifi.isEnabled() && _cbWifi.isChecked()) {
            WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
            wifiManager.setWifiEnabled(false);
        }
        if (_currentState.optBoolean((String) getTag(R.id.cbMute), false)) {
            lowerVolume(0);
        }
        Toast toast = Toast.makeText(getApplicationContext(), "Timer Complete", Toast.LENGTH_SHORT);
        toast.show();
    } catch (Exception e) {
        Toast toast = Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG);
        toast.show();
    }
    _runSeconds = 0;
    setRunSeconds();
    clearNotification();
}

[Buggy Hunk]
if (_currentState.optBoolean((String) getTag(R.id.cbMute), false)) {

[Patch]
if (_currentState != null && _currentState.optBoolean((String) getTag(R.id.cbMute), false)) {

[Demonstration 3]

[Buggy Method]
private void updateFeatureView(final View view, final Feature feature) {
    TextView nameTextView = (TextView) view.findViewById(R.id.list_item_feature_name_view);
    TextView descriptionTextView = (TextView) view.findViewById(R.id.list_item_feature_description_view);
    Switch switchView = (Switch) view.findViewById(R.id.list_item_feature_switch);
    nameTextView.setText(feature.getName());
    descriptionTextView.setText(feature.getDescription());
    switchView.setChecked(feature.isEnabled());
    switchView.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            onFeatureToggledListener.onFeatureToggled(feature, isChecked);
        }
    });
}

[Buggy Hunk]
switchView.setChecked(feature.isEnabled());

[Patch]
switchView.setChecked(flipTheSwitch.isFeatureEnabled(feature.getName()));