[Demonstration 1]

[Buggy Method]
private List<Integer[]> optimize(List<String> values) {
    if (CollectionUtils.size(values) <= 1) {
        Collections.emptyList();
    }
    List<Integer[]> retList = new ArrayList<Integer[]>();
    Integer minValue = null;
    Integer maxValue = null;
    Integer intValue = null;
    Integer preValue = null;
    // create integer list
    List<Integer> subValues = new ArrayList<Integer>(values.size());
    try {
        for (String value : values) {
            subValues.add(Integer.parseInt(value));
        }
        Collections.sort(subValues);
    } catch (NumberFormatException e) {
        log.info("NumberFormatException intValue=" + intValue, e);
        return Collections.emptyList();
    }
    int index = 0;
    while (index < subValues.size()) {
        intValue = subValues.get(index);
        if (index == 0) {
            minValue = intValue;
            maxValue = minValue;
        } else {
            // equals
            if (preValue.intValue() == intValue.intValue()) {
                maxValue = preValue;
            } else if (preValue + 1 != intValue.intValue()) {
                // add another between clause
                retList.add(new Integer[] { minValue, preValue });
                minValue = intValue;
                maxValue = intValue;
            } else {
                maxValue = preValue + 1;
            }
        }
        preValue = intValue;
        index++;
    }
    // add between clause
    retList.add(new Integer[] { minValue, maxValue });
    // if the optimized parameters is
    if (retList.size() * 2 < values.size()) {
        return retList;
    } else {
        return Collections.emptyList();
    }
}

[Buggy Hunk]
log.info("NumberFormatException intValue=" + intValue, e);

[Patch]
log.debug(intValue + " cannot be converted to a number");

[Demonstration 2]

[Buggy Method]
public void show() {
    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(Main.class.getResource("/MainWindow.fxml"));
        loader.setController(this);
        BorderPane rootLayout = loader.load();
        primaryStage.setTitle("Urban traffic monitoring - charts");
        Scene scene = new Scene(rootLayout);
        scene.getStylesheets().add(Main.class.getResource("/chart.css").toExternalForm());
        primaryStage.setScene(scene);
        primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {

            public void handle(WindowEvent we) {
                Connector.killAll();
                Platform.exit();
            }
        });
        scene.getStylesheets().add(getClass().getResource("/style.css").toExternalForm());
        primaryStage.show();
    } catch (java.io.IOException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
Scene scene = new Scene(rootLayout);

[Patch]
scene = new Scene(rootLayout);

[Demonstration 3]

[Buggy Method]
protected void moveSelectedRight() {
    if (selected != null) {
        final List<Component> l = stackSec.getOrderedComponents();
        final int index = l.indexOf(selected);
        final int last = l.size() - 1;
        if (index < last) {
            stackSec.setComponentOrder(selected, index + 1);
            genEvents();
        }
    }
}

[Buggy Hunk]
protected void moveSelectedRight() {

[Patch]
protected final void moveSelectedRight() {