[Demonstration 1]

[Buggy Method]
public void deleteRecursive(String path) throws Exception {
    path = getPath(path);
    delete(path);
    LOGGER.info("rmr: node:{}", path);
}

[Buggy Hunk]
delete(path);

[Patch]
getClient().delete().deletingChildrenIfNeeded().forPath(path);

[Demonstration 2]

[Buggy Method]
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
    HttpServletRequest request = (HttpServletRequest) servletRequest;
    HttpServletResponse response = (HttpServletResponse) servletResponse;
    String path = request.getRequestURI();
    if (!path.startsWith("/screen/LoginScreen.xhtml")) {
        String loginUrl = request.getContextPath() + "/screen/LoginScreen.xhtml";
        HttpSession session = request.getSession(false);
        Person user = (session != null) ? (Person) session.getAttribute("user") : null;
        if (user == null) {
            response.sendRedirect(loginUrl);
        }
    }
    filterChain.doFilter(servletRequest, servletResponse);
}

[Buggy Hunk]
HttpSession session = request.getSession(false);

[Patch]
HttpSession session = request.getSession();

[Demonstration 3]

[Buggy Method]
public void trainAnfis() {
    //Anfis anfis = setParameters();
    Anfis anfis = Anfis.loadAnfisFromFile("ANFIS_conf_initial.xml");
    ;
    double[][] A = FileOperations.readData("train_inputs.csv", ",");
    double[][] B = FileOperations.readData("train_outputs.csv", ",");
    //Convert [P][1] to [1][P] and then keep only first row (converting 2D array into 1D)
    try {
        B = MatrixOperations.transpose(B);
    } catch (Exception e) {
        e.printStackTrace();
    }
    int epochs = 100;
    double error = 0.01;
    System.out.println("Starting with:");
    System.out.println("epochs=" + epochs + "; error=" + error + " training data size=" + A.length + " ...");
    anfis.startHybridLearning(epochs, error, A, B[0], true);
    // Save ANFIS config in a file
    anfis.saveAnfisToFile("ANFIS_conf_trained.xml");
}

[Buggy Hunk]
anfis.startHybridLearning(epochs, error, A, B[0], true);

[Patch]
anfis.startHybridLearning(epochs, error, A, B[0], true, false);