[Demonstration 1]

[Buggy Method]
@Override
synchronized public void consumeReward(Reward reward) {
    String key = String.format("%d", reward.getOfferId());
    SharedPreferences prefs = app.getApplicationContext().getSharedPreferences(WOM_REWARDS_KEY, Context.MODE_PRIVATE);
    prefs.edit().putInt(key, prefs.getInt(key, 0) + 1).apply();
}

[Buggy Hunk]
String key = String.format("%d", reward.getOfferId());

[Patch]
String key = Integer.toString(reward.getOfferId());

[Demonstration 2]

[Buggy Method]
public static void changeVirtualizerState(Context context, boolean state) {
    Intent intent = new Intent(context, PlaybackService.class);
    intent.setAction(ACTION_PLAYBACK_VIRTUALIZER_STATE);
    intent.putExtra(PLAYBACK_EXTRA_BASS_BOOST_STATE, state);
    context.startService(intent);
}

[Buggy Hunk]
intent.putExtra(PLAYBACK_EXTRA_BASS_BOOST_STATE, state);

[Patch]
intent.putExtra(PLAYBACK_EXTRA_VIRTUALIZER_STATE, state);

[Demonstration 3]

[Buggy Method]
@Override
public void onLogin(String webContent) {
    // store the data in preference
    SharedPreferences prefs = getSharedPreferences(PREFERENCE, Context.MODE_PRIVATE);
    prefs.edit().putString(KEY_DATA, webContent).putBoolean(KEY_LOGIN_SUCCESS, true).apply();
    // display the action bar
    setDisplayActionBar(true);
    // change to main fragment
    Bundle arg = new Bundle();
    arg.putString(MainFragment.KEY_CONTENT, webContent);
    if (mainFragment == null) {
        mainFragment = new MainFragment();
    }
    mainFragment.setArguments(arg);
    // protect from crashing
    // if the user decide to hide the ui
    // and the retrieve task return
    try {
        getFragmentManager().beginTransaction().replace(R.id.container, mainFragment).commit();
    } catch (IllegalStateException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
SharedPreferences prefs = getSharedPreferences(PREFERENCE, Context.MODE_PRIVATE);

[Patch]
final SharedPreferences prefs = getSharedPreferences(PREFERENCE, Context.MODE_PRIVATE);