[Demonstration 1]

[Buggy Method]
private void render(Word previous, boolean rescale) {
    renderKeyboard();
    Clue c = BOARD.getClue();
    BOARD.toggleDirection();
    BOARD.toggleDirection();
    if (c.hint == null) {
        BOARD.toggleDirection();
        c = BOARD.getClue();
    }
    this.boardView.setBitmap(RENDERER.draw(previous), rescale);
    this.boardView.requestFocus();
    /*
		 * If we jumped to a new word, ensure the first letter is visible.
		 * Otherwise, insure that the current letter is visible. Only necessary
		 * if the cursor is currently off screen.
		 */
    if (rescale && this.prefs.getBoolean("ensureVisible", true)) {
        Point topLeft;
        Point bottomRight;
        Point cursorTopLeft;
        Point cursorBottomRight;
        cursorTopLeft = RENDERER.findPointTopLeft(BOARD.getHighlightLetter());
        cursorBottomRight = RENDERER.findPointBottomRight(BOARD.getHighlightLetter());
        if ((previous != null) && previous.equals(BOARD.getCurrentWord())) {
            topLeft = cursorTopLeft;
            bottomRight = cursorBottomRight;
        } else {
            topLeft = RENDERER.findPointTopLeft(BOARD.getCurrentWordStart());
            bottomRight = RENDERER.findPointBottomRight(BOARD.getCurrentWordStart());
        }
        int tlDistance = cursorTopLeft.distance(topLeft);
        int brDistance = cursorBottomRight.distance(bottomRight);
        if (!this.boardView.isVisible(topLeft) && (tlDistance < brDistance)) {
            this.boardView.ensureVisible(topLeft);
        }
        if (!this.boardView.isVisible(bottomRight) && (brDistance < tlDistance)) {
            this.boardView.ensureVisible(bottomRight);
        }
        // ensure the cursor is always on the screen.
        this.boardView.ensureVisible(cursorBottomRight);
        this.boardView.ensureVisible(cursorTopLeft);
    }
    this.clue.setText("(" + (BOARD.isAcross() ? "across" : "down") + ") " + c.number + ". " + c.hint + (this.showCount ? ("  [" + BOARD.getCurrentWord().length + "]") : ""));
    if (this.allClues != null) {
        if (BOARD.isAcross()) {
            ClueListAdapter cla = (ClueListAdapter) this.allCluesAdapter.sections.get(0);
            cla.setActiveDirection(BOARD.isAcross());
            cla.setHighlightClue(c);
            this.allCluesAdapter.notifyDataSetChanged();
            this.allClues.setSelectionFromTop(cla.indexOf(c) + 1, (this.allClues.getHeight() / 2) - 50);
        } else {
            ClueListAdapter cla = (ClueListAdapter) this.allCluesAdapter.sections.get(1);
            cla.setActiveDirection(!BOARD.isAcross());
            cla.setHighlightClue(c);
            this.allCluesAdapter.notifyDataSetChanged();
            this.allClues.setSelectionFromTop(cla.indexOf(c) + BOARD.getAcrossClues().length + 2, (this.allClues.getHeight() / 2) - 50);
        }
    }
    if (this.down != null) {
        this.downAdapter.setHighlightClue(c);
        this.downAdapter.setActiveDirection(!BOARD.isAcross());
        this.downAdapter.notifyDataSetChanged();
        if (!BOARD.isAcross() && !c.equals(this.down.getSelectedItem())) {
            if (this.down instanceof ListView) {
                ((ListView) this.down).setSelectionFromTop(this.downAdapter.indexOf(c), (down.getHeight() / 2) - 50);
            } else {
                // Gallery
                this.down.setSelection(this.downAdapter.indexOf(c));
            }
        }
    }
    if (this.across != null) {
        this.acrossAdapter.setHighlightClue(c);
        this.acrossAdapter.setActiveDirection(BOARD.isAcross());
        this.acrossAdapter.notifyDataSetChanged();
        if (BOARD.isAcross() && !c.equals(this.across.getSelectedItem())) {
            if (across instanceof ListView) {
                ((ListView) this.across).setSelectionFromTop(this.acrossAdapter.indexOf(c), (across.getHeight() / 2) - 50);
            } else {
                // Gallery view
                this.across.setSelection(this.acrossAdapter.indexOf(c));
            }
        }
    }
    if ((puz.getPercentComplete() == 100)) {
        stopTimer();
        Intent i = new Intent(PlayActivity.this, PuzzleFinishedActivity.class);
        this.startActivity(i);
    }
    this.boardView.requestFocus();
}

[Buggy Hunk]
if ((puz.getPercentComplete() == 100)) {

[Patch]
if ((puz.getPercentComplete() == 100) && isTiming()) {

[Demonstration 2]

[Buggy Method]
public static void initGui(MainFrame mainframe) {
    final SimpleWindow simpleWindow = new SimpleWindow();
    mainframe.getDockingDesktop().registerDockable(simpleWindow);
    JMenu menu = new ResourceMenu("tutorial.tutorial");
    menu.add(new ResourceAction("tutorial.greetings", "Earthling") {

        private static final long serialVersionUID = 1L;

        @Override
        public void actionPerformed(ActionEvent e) {
            simpleWindow.setLabel("Greetings, Earthling");
        }
    });
    mainframe.getMainMenuBar().add(menu);
}

[Buggy Hunk]
mainframe.getMainMenuBar().add(menu);

[Patch]
mainframe.addMenu(-1, menu);