[Demonstration 1]

[Buggy Method]
@Override
public void update(int dt) {
    selectedButton = Button.update(buttons, selectedButton);
    InputControl input = InputControl.instance();
    switch(state) {
        case POKEDEX:
            if (input.consumeIfDown(ControlKey.SPACE)) {
                if (!displayInfo) {
                    displayInfo = true;
                } else {
                    message = null;
                }
            }
            if (message == null) {
                setState(State.NICKNAME_QUESTION);
            }
            break;
        case NICKNAME_QUESTION:
            if (rightButton().checkConsumePress()) {
                setState(State.LOCATION);
            }
            if (leftButton().checkConsumePress()) {
                setState(State.NICKNAME);
            }
            break;
        case NICKNAME:
            if (!input.isCapturingText()) {
                input.startTextCapture();
            }
            if (input.consumeIfDown(ControlKey.ENTER)) {
                input.stopTextCapture();
                String nickname = input.getCapturedText(ActivePokemon.MAX_NAME_LENGTH);
                newPokemon.setNickname(nickname);
                setState(State.LOCATION);
            }
            break;
        case LOCATION:
            if (rightButton().checkConsumePress()) {
                setState(State.END);
            }
            if (leftButton().checkConsumePress()) {
                setState(State.PARTY_SELECTION);
            }
            break;
        case PARTY_SELECTION:
            if (input.consumeIfDown(ControlKey.BACK)) {
                setState(State.END);
            }
            CharacterData player = Game.getPlayer();
            List<ActivePokemon> party = player.getTeam();
            for (int row = 0; row < 2; row++) {
                for (int col = 0; col < Trainer.MAX_POKEMON / 2; col++) {
                    int buttonIndex = Point.getIndex(col, row, NUM_COLS);
                    int partyIndex = Point.getIndex(col, row, Trainer.MAX_POKEMON / 2);
                    Button pokemonButton = buttons[buttonIndex];
                    if (pokemonButton.checkConsumePress()) {
                        ActivePokemon newPokemon = this.newPokemon;
                        this.newPokemon = party.get(partyIndex);
                        player.getPC().switchPokemon(newPokemon, partyIndex);
                        setState(State.END);
                        break;
                    }
                }
            }
            break;
        case END:
            if (input.consumeIfDown(ControlKey.SPACE)) {
                message = null;
            }
            if (message == null) {
                Game.instance().popView();
            }
            break;
    }
}

[Buggy Hunk]
Game.instance().popView();

[Patch]
Game.instance().setViewMode(ViewMode.MAP_VIEW);

[Demonstration 2]

[Buggy Method]
public void close() {
    this.sessionFactory.getCurrentSession().close();
}

[Buggy Hunk]
this.sessionFactory.getCurrentSession().close();

[Patch]
getSessionFactory().getCurrentSession().close();

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    // The capteur
    CaptorImpl captor = new CaptorImpl(null);
    captor.setDiffuseStrategy(DiffusionType.ATOMIC);
    CaptorScheduleProcessor process = new CaptorScheduleProcessor(1, 1500, 1);
    process.incrementWithStepByPeriod(captor, 200);
    // First canal
    Channel channel1 = new Channel(captor);
    Display display1 = new Display(null);
    channel1.setDelay(150);
    channel1.attach(display1);
    // Second canal
    Channel channel2 = new Channel(captor);
    Display display2 = new Display(null);
    channel2.setDelay(600);
    channel2.attach(display2);
}

[Buggy Hunk]
process.incrementWithStepByPeriod(captor, 200);

[Patch]
process.incrementWithStepByPeriod(captor, 200, TimeUnit.MILLISECONDS);