[Demonstration 1]

[Buggy Method]
private void selectItem(int position) {
    // Create a new fragment and specify the planet to show based on position
    if ((Utils.getUserProfileSharedPrefs(getApplicationContext(), Constants.USER_NAME).equals(Constants.EMPTY))) {
        switch(position) {
            case 0:
                Intent intent = new Intent(this, LoginActivity.class);
                startActivity(intent);
        }
    } else {
        switch(position) {
            case 0:
                LoginActivity loginActivity = new LoginActivity();
                Boolean signed_out = signOut();
                if (signed_out) {
                    Utils.setUserProfileSharedPreference(getApplicationContext(), Constants.USER_NAME, Constants.EMPTY);
                    Utils.setUserProfileSharedPreference(getApplicationContext(), Constants.USER_EMAIL, Constants.EMPTY);
                    Utils.setUserProfileSharedPreference(getApplicationContext(), Constants.USER_PROFILE_URL, Constants.EMPTY);
                    setDataInDrawer();
                    Toast.makeText(this, "logged out", Toast.LENGTH_SHORT).show();
                }
                break;
        }
    }
    // Highlight the selected item, and close the drawer
    mDrawerList.setItemChecked(position, true);
    mDrawerLayout.closeDrawer(mDrawerRelativeLayout);
}

[Buggy Hunk]
Toast.makeText(this, "logged out", Toast.LENGTH_SHORT).show();

[Patch]
Toast.makeText(this, R.string.logged_out, Toast.LENGTH_SHORT).show();

[Demonstration 2]

[Buggy Method]
private static String printValue(ParseTree value) {
    if (value instanceof ExpContext) {
        return printValue((ExpContext) value);
    }
    if (value instanceof StringContext) {
        return value.getText();
    }
    if (value instanceof NumberContext) {
        return value.getText();
    }
    if (value instanceof TableconstructorContext) {
        return printValue((TableconstructorContext) value);
    }
    if (value instanceof PrefixexpContext) {
        return "\"" + value.getText() + "\"";
    }
    if (value instanceof TerminalNodeImpl) {
        return "\"" + value.getText() + "\"";
    }
    throw new RuntimeException("Unhandled value class: " + value.getClass().getName() + " = " + value.getParent().getText());
}

[Buggy Hunk]
return printValue((TableconstructorContext) value);

[Patch]
return printValue((TableconstructorContext) value , false );

[Demonstration 3]

[Buggy Method]
@Override
public String toString(String value) {
    return "'" + value.replaceAll("'", "\\'") + "'";
}

[Buggy Hunk]
return "'" + value.replaceAll("'", "\\'") + "'";

[Patch]
return "'" + value.replace("'", "\\'") + "'";