[Demonstration 1]

[Buggy Method]
public static void showCardCheckFragment(FragmentManager fm, String current, String lastTransaction) {
    MainActivity.setToolbarShadow(false);
    CardCheckFragment fragment = CardCheckFragment.newInstance(current, lastTransaction);
    fm.beginTransaction().replace(R.id.cardCheckContainer, fragment, "CARD_CHECK_FRAGMENT").commit();
}

[Buggy Hunk]
fm.beginTransaction().replace(R.id.cardCheckContainer, fragment, "CARD_CHECK_FRAGMENT").commit();

[Patch]
fm.beginTransaction().replace(R.id.cardCheckContainer, fragment, "CARD_CHECK_FRAGMENT").commitAllowingStateLoss();

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    // Tải view từ template xml
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    ConfigUtil.setPlatForm(ConfigUtil.PLATFORM_MAGENTO_1);
    STORE_ID = DataUtil.getDataStringToPreferences(getContext(), DataUtil.STORE_ID);
    // cấu hình lại các layout control
    initControlLayout();
    // thiết lập các giá trị ban đầu
    initControlValue();
    showProgress(false);
}

[Buggy Hunk]
ConfigUtil.setPlatForm(ConfigUtil.PLATFORM_MAGENTO_1);

[Patch]
ConfigUtil.setPlatForm(ConfigUtil.PLATFORM_MAGENTO_2);

[Demonstration 3]

[Buggy Method]
private void json2login(String jsonUser) {
    Gson gson = new Gson();
    user = gson.fromJson(jsonUser, User.class);
    Log.d(TAG, "json2login: " + user);
    profile.userId = user.getId();
    profile.username = user.getName();
    profile.email = user.getEmail();
    profile.pictureUrl = user.getPicture();
    if ("undefined?sz=200".equals(profile.pictureUrl)) {
        profile.pictureUrl = "https://ssl.gstatic.com/images/branding/product/1x/avatar_square_grey_512dp.png";
    }
    profile.save(getApplicationContext());
    if (checkPlayServices()) {
        Intent intent = new Intent(this, RegistrationIntentService.class);
        startService(intent);
    }
    launchInSquare();
}

[Buggy Hunk]
profile.pictureUrl = "https://ssl.gstatic.com/images/branding/product/1x/avatar_square_grey_512dp.png";

[Patch]
profile.pictureUrl = getString(R.string.avatarURL);