[Demonstration 1]

[Buggy Method]
public String changeLanguage(String selectedLanguage) {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Cookie cookie = new Cookie(Constants.LANGUAGE, selectedLanguage);
    HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
    response.addCookie(cookie);
    this.selectedLanguage = selectedLanguage;
    setupLanguage();
    FacesContext context = FacesContext.getCurrentInstance();
    context.getExternalContext().getSessionMap().put("lang", lang);
    return "";
}

[Buggy Hunk]
context.getExternalContext().getSessionMap().put("lang", lang);

[Patch]
context.getExternalContext().getSessionMap().put(Constants.SESSION_LANGUAGE, lang);

[Demonstration 2]

[Buggy Method]
public static void updateLanguage(Context context, String newLanguage) {
    Configuration configuration = new Configuration();
    String language = WAILSettings.getLanguage(context);
    String lang = lang(language);
    String newLang = lang(newLanguage);
    if (TextUtils.isEmpty(language) && newLanguage == null) {
        configuration.locale = Locale.getDefault();
    } else if (newLanguage != null) {
        configuration.locale = new Locale(newLang);
        WAILSettings.setLanguage(context, newLanguage);
    } else if (!TextUtils.isEmpty(language)) {
        configuration.locale = new Locale(lang);
    }
    context.getResources().updateConfiguration(configuration, null);
    if (newLang != null && !lang.equals(newLang)) {
        Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(intent);
    }
}

[Buggy Hunk]
if (newLang != null && !lang.equals(newLang)) {

[Patch]
if (newLang != null && !newLang.equals(lang)) {

[Demonstration 3]

[Buggy Method]
private void initViewPager() {
    ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
    adapter.addFragment(IntroFragment.newInstance(R.color.blue));
    adapter.addFragment(IntroFragment.newInstance(R.color.red));
    adapter.addFragment(IntroFinishFragment.newInstance(R.color.green));
    viewPagerInto.setAdapter(adapter);
    indicatordots.setViewPager(viewPagerInto);
}

[Buggy Hunk]
adapter.addFragment(IntroFinishFragment.newInstance(R.color.green));

[Patch]
adapter.addFragment(IntroFragment.newInstance(R.color.green));