[Demonstration 1]

[Buggy Method]
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}

[Buggy Hunk]
if (id == R.id.action_settings)

[Patch]
if (id == R.id.MainMenu_action_settings)

[Demonstration 2]

[Buggy Method]
public void updateMark(int posx, int posy) {
    // Edit works for both comment and rubric marks only
    if (this instanceof RubricMark || this instanceof CommentMark) {
        final Mark mark = (Mark) this;
        // If the mark is a rubric get its level
        int level = 0;
        int regradeid = 0;
        if (mark instanceof RubricMark) {
            regradeid = ((RubricMark) mark).getRegradeid();
            level = ((RubricMark) mark).getLevelId();
        }
        // Create the comment dialog with the corresponding rubric level
        EditMarkDialog dialog = new EditMarkDialog(posx, posy, level, regradeid);
        if (mark instanceof RubricMark && regradeid > 0) {
            dialog.getTxtRegradeComment().setText(((RubricMark) mark).getRegrademarkercomment());
        }
        // Set dialog's current values to the mark's
        dialog.setTxtComment(mark.getRawtext());
        // Update when closing
        dialog.addCloseHandler(new CloseHandler<PopupPanel>() {

            @Override
            public void onClose(CloseEvent<PopupPanel> event) {
                EditMarkDialog dialog = (EditMarkDialog) event.getSource();
                MarkingPage page = EMarkingWeb.markingInterface.getMarkingPagesInterface().getPageByIndex(pageno);
                int widthPage = page.getWidth();
                int heightPage = page.getHeight();
                // If the dialog was not cancelled update the mark with the dialog values
                if (!dialog.isCancelled()) {
                    mark.update(dialog.getTxtComment(), mark.getPosx(), mark.getPosy(), dialog.getLevelId(), dialog.getBonus(), dialog.getRegradeComment(), dialog.getRegradeAccepted(), widthPage, heightPage);
                }
            }
        });
        // Show the dialog
        dialog.show();
    }
}

[Buggy Hunk]
MarkingPage page = EMarkingWeb.markingInterface.getMarkingPagesInterface().getPageByIndex(pageno);

[Patch]
MarkingPage page = EMarkingWeb.markingInterface.getMarkingPagesInterface().getPageByIndex(pageno-1);

[Demonstration 3]

[Buggy Method]
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}

[Buggy Hunk]
if (id == R.id.action_settings) {

[Patch]
if (id == R.id.action_about) {