[Demonstration 1]

[Buggy Method]
public void service(HttpServletRequest req, HttpServletResponse resp) {
    resp.setContentType("text/html");
    PrintWriter out = null;
    try {
        out = resp.getWriter();
    } catch (IOException e) {
        e.printStackTrace();
    }
    boolean res = book.addBook("Test", "Test");
    if (res) {
        out.println("<html><body>Ajout reussi</body></html>");
    } else {
        out.println("<html><body>Ajout non reussi</body></html>");
    }
}

[Buggy Hunk]
boolean res = book.addBook("Test", "Test");

[Patch]
boolean res = book.addBook(new Author("Test"), "Test");

[Demonstration 2]

[Buggy Method]
protected boolean mouseOverSlider(int x, int y, int cx, int cy) {
    return x > slide && x < slide + 15 && y > cy && y < cy + panel.getHeight();
}

[Buggy Hunk]
return x > slide && x < slide+15 && y > cy && y < cy+panel.getHeight();

[Patch]
return x > slide && x < slide+15 && y > cy && y < cy+getHeight();

[Demonstration 3]

[Buggy Method]
private Boolean applySettings() {
    ObservableList<Node> observList = settingsGrid.getChildren();
    Label label;
    TextField textField;
    for (Node l : observList) {
        if (l.getClass() != Label.class) {
            continue;
        }
        label = (Label) l;
        Node inputNode = label.getLabelFor();
        if (label.getStyleClass() != null && label.getStyleClass().contains("titleLabel")) {
            continue;
        }
        String propertyValue = "";
        if (inputNode instanceof TextField) {
            textField = (TextField) inputNode;
            propertyValue = textField.getText();
            // Show error message if username is invalid
            if (label.getText().equals("userName") && UserInfo.validateUserName(textField.getText()) == false) {
                showInputError("Please make sure to choose a valid username. '" + textField.getText() + "' is not a valid username.");
                return false;
            }
        } else if (inputNode instanceof ComboBox<?>) {
            @SuppressWarnings("unchecked")
            ComboBox<String> cBox = (ComboBox<String>) inputNode;
            propertyValue = cBox.getValue();
        }
        App.properties.setProperty(inputNode.getId(), propertyValue);
    }
    try {
        App.properties.store(new FileOutputStream(App.pathToProperties), null);
        logger.log(ErrorFactory.build(Level.INFO, LogKey.info, "Saved properties to " + App.pathToProperties));
        App.properties.load(new FileInputStream(new File(App.pathToProperties)));
        return true;
    } catch (FileNotFoundException e) {
        logger.log(ErrorFactory.build(Level.SEVERE, LogKey.error, "FileNotFoundException thrown: ", e));
    } catch (IOException e) {
        logger.log(ErrorFactory.build(Level.SEVERE, LogKey.error, "IOException thrown: ", e));
    }
    return false;
}

[Buggy Hunk]
if (label.getText().equals("userName") && UserInfo.validateUserName(textField.getText()) == false) {

[Patch]
if (inputNode.getId().equals("userName") && UserInfo.validateUserName(textField.getText()) == false) {