[Demonstration 1]

[Buggy Method]
@Override
public int getCalculatedPreferredNetworkType() {
    enforceReadPermission();
    return PhoneFactory.calculatePreferredNetworkType(mPhone.getContext());
}

[Buggy Hunk]
return PhoneFactory.calculatePreferredNetworkType(mPhone.getContext());

[Patch]
return PhoneFactory.calculatePreferredNetworkType(mPhone.getContext(), 0); // wink FIXME: need to get SubId from somewhere.

[Demonstration 2]

[Buggy Method]
public void selectItem(int position) {
    mPosition = position;
    mDrawerList.setItemChecked(mPosition, true);
    mDrawerLayout.closeDrawer(mDrawerList);
    if (position == 0) {
        //month view
    } else if (position == 1) {
        //all events
        if (!(mContext instanceof AllEventsActivity)) {
            Intent intent = new Intent(mContext, AllEventsActivity.class);
            mContext.startActivity(intent);
        }
    } else if (position == 2) {
        //home
        if (!(mContext instanceof HomepageActivity)) {
            Intent intent = new Intent(mContext, HomepageActivity.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            mContext.startActivity(intent);
        }
    } else if (position == 3) {
        //search
    } else if (position == 4) {
        //log out
        ref.unauth();
        Intent intent = new Intent(mContext, LoginActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        mContext.startActivity(intent);
    }
}

[Buggy Hunk]
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

[Patch]
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);

[Demonstration 3]

[Buggy Method]
@EventSubscriber
public void onReady(ReadyEvent e) throws DiscordException, RateLimitException, MissingPermissionsException {
    IDiscordClient cl = main.getClient(null);
    main.logToBoth("Beginning ReadyEvent Init...");
    try {
        main.logToBoth("Attempting to change username, please wait...");
        if (IDReference.ENVIRONMENT == IDReference.RuntimeEnvironment.Live) {
            main.logToBoth("Logging in to LIVE server.");
            cl.changeUsername("Krystara");
        } else {
            main.logToBoth("Logging in to TESTING server.");
            cl.changeUsername("Krystara *Testing*");
        }
        main.logToBoth("Changing image...");
        cl.changeAvatar(Image.forUrl("png", "http://repo.samboycoding.me/static/krystarabot_icon.png"));
    } catch (DiscordException ex) {
        main.logToBoth("Failed to change username. Rate limited most likely. Message: " + ex.getMessage());
    }
    try {
        main.logToBoth("Setting status...");
        cl.changeStatus(Status.game("?help"));
        main.logToBoth("My ID: " + main.getClient(null).getApplicationClientID());
        IDReference.MYID = main.getClient(null).getApplicationClientID();
        main.logToBoth("Registering commands...");
        main.registerCommand(new BanCommand());
        main.registerCommand(new BuildcacheCommand());
        main.registerCommand(new ClassCommand());
        main.registerCommand(new ClearCommand());
        main.registerCommand(new ClearcacheCommand());
        main.registerCommand(new ReigsterCodeCommand());
        //main.registerCommand(new CodesCommand());
        //main.registerCommand(new DeadCommand());
        main.registerCommand(new HelpCommand());
        main.registerCommand(new KickCommand());
        main.registerCommand(new KingdomCommand());
        main.registerCommand(new ListQuestionsCommand());
        main.registerCommand(new NewcodeCommand());
        main.registerCommand(new PingCommand());
        main.registerCommand(new PlatformCommand());
        main.registerCommand(new QuestionCommand());
        main.registerCommand(new QuizCommand());
        main.registerCommand(new ReloadDataCommand());
        main.registerCommand(new SearchCommand());
        main.registerCommand(new ServerstatsCommand());
        main.registerCommand(new SpellCommand());
        main.registerCommand(new StopQuizCommand());
        main.registerCommand(new TeamCommand());
        main.registerCommand(new Top10Command());
        main.registerCommand(new TraitCommand());
        main.registerCommand(new TraitstoneCommand());
        main.registerCommand(new TroopCommand());
        main.registerCommand(new UserstatsCommand());
        main.registerCommand(new WarnCommand());
        main.registerCommand(new WeaponCommand());
        String timestamp = "";
        Calendar now = main.getNow();
        timestamp += now.get(Calendar.DATE) + " of ";
        timestamp += new DateFormatSymbols().getMonths()[now.get(Calendar.MONTH)];
        timestamp += " " + now.get(Calendar.YEAR) + " at ";
        timestamp += main.getTimestamp("hh:mm:ss") + ".";
        EmbedObject o = new EmbedBuilder().withAuthorName("KrystaraBot").withAuthorIcon("http://repo.samboycoding.me/static/krystarabot_icon.png").withColor(Color.green).withDesc("Bot started on " + timestamp).withTitle("Hello, world!").build();
        e.getClient().getGuildByID(IDReference.SERVERID).getChannelByID(IDReference.LOGSCHANNEL).sendMessage("", o, false);
        main.logToBoth("Finished processing readyEvent. Bot is 100% up now.\n\n");
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

[Buggy Hunk]
if (IDReference.ENVIRONMENT == IDReference.RuntimeEnvironment.Live)

[Patch]
if (IDReference.ENVIRONMENT == IDReference.RuntimeEnvironment.LIVE)