[Demonstration 1]

[Buggy Method]
@ResponseBody
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(Throwable.class)
public Error handleException(Throwable e) {
    LOGGER.error("", e);
    return new Error(500, "Ups ... unexpected error occurred ! !");
}

[Buggy Hunk]
return new Error(500, "Ups ... unexpected error occurred ! !");

[Patch]
return new Error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Ups ... unexpected error occurred ! !");

[Demonstration 2]

[Buggy Method]
@Override
public void actionPerformed(ActionEvent e) {
    //Previous card
    if (e.getSource() == prev) {
        id -= 1;
        if (id < 0) {
            id = currentImgSet.size() - 1;
        }
        buttonIcon = new ImageIcon(String.valueOf(currentImgSet.get(id)));
        cardButton.setIcon(ResizedIcon(buttonIcon, 500, 700));
    } else //Next card
    if (e.getSource() == next) {
        id += 1;
        if (id > currentImgSet.size() - 1) {
            id = 0;
        }
        buttonIcon = new ImageIcon(String.valueOf(currentImgSet.get(id)));
        cardButton.setIcon(ResizedIcon(buttonIcon, 500, 700));
    } else //Choose card
    if (e.getSource() == cardButton) {
        //If it is a SuperTrump card
        if (superTrumps.contains(currentCardSet.get(id).getName())) {
            if (firstTurn) {
                label.setText("Player " + playerTurn + "'s turn! You cannot use a SuperTrump card right now!");
            } else {
                if (Objects.equals(currentCardSet.get(id).getName(), "geologist")) {
                    trumpSelect = JOptionPane.showInputDialog(mp, "Select which value to use (Hardness, Gravity, Cleavage, Abundance, EcoValue)", "hardness").toLowerCase();
                    while (!(trumps.contains(trumpSelect))) {
                        trumpSelect = JOptionPane.showInputDialog(mp, "Please input correctly! (Hardness, Gravity, Cleavage, Abundance, EcoValue)", "hardness").toLowerCase();
                    }
                } else {
                    trumpSelect = currentCardSet.get(id).getTrump();
                }
                currentHighest = 0;
                topIcon = new ImageIcon("Slide66.jpg");
                topCard.setIcon(ResizedIcon(topIcon, 500, 700));
                flag = true;
            }
        } else //If it is a regular card
        {
            if (firstTurn) {
                trumpSelect = JOptionPane.showInputDialog(mp, "Select which value to use (Hardness, Gravity, Cleavage, Abundance, EcoValue)", "hardness").toLowerCase();
                while (!(trumps.contains(trumpSelect))) {
                    trumpSelect = JOptionPane.showInputDialog(mp, "Please input correctly! (Hardness, Gravity, Cleavage, Abundance, EcoValue)", "hardness").toLowerCase();
                }
                currentHighest = currentCardSet.get(id).getValueBasedOnInput(trumpSelect);
                topIcon = new ImageIcon(String.valueOf(currentImgSet.get(id)));
                topCard.setIcon(ResizedIcon(topIcon, 500, 700));
                firstTurn = false;
                flag = true;
            } else {
                valueSelect = currentCardSet.get(id).getValueBasedOnInput(trumpSelect);
                if (valueSelect < currentHighest) {
                    label.setText("Player " + playerTurn + "'s turn! The value is not high enough!");
                } else {
                    currentHighest = valueSelect;
                    topIcon = new ImageIcon(String.valueOf(currentImgSet.get(id)));
                    topCard.setIcon(ResizedIcon(topIcon, 500, 700));
                    flag = true;
                }
            }
        }
        if (flag) {
            PostProcessing();
            flag = false;
        }
    } else //Pass turn
    if (e.getSource() == pass) {
        playerPass.add("player" + playerTurn);
        Game.DrawCard(cards, imgs, currentCardSet, currentImgSet);
        PostProcessing();
    }
}

[Buggy Hunk]
if (id > currentImgSet.size() - 1) {

[Patch]
if (id >= currentImgSet.size()) {

[Demonstration 3]

[Buggy Method]
@Override
public final void invoke(Request request, Response response) throws IOException, ServletException {
    // Select the Context to be used for this Request
    Context context = request.getContext();
    if (context == null) {
        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, sm.getString("standardHost.noContext"));
        return;
    }
    if (request.isAsyncSupported()) {
        request.setAsyncSupported(context.getPipeline().isAsyncSupported());
    }
    boolean asyncAtStart = request.isAsync();
    boolean asyncDispatching = request.isAsyncDispatching();
    try {
        context.bind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
        if (!asyncAtStart && !context.fireRequestInitEvent(request)) {
            // Don't fire listeners during async processing (the listener
            // fired for the request that called startAsync()).
            // If a request init listener throws an exception, the request
            // is aborted.
            return;
        }
        // Ask this Context to process this request. Requests that are in
        // async mode and are not being dispatched to this resource must be
        // in error and have been routed here to check for application
        // defined error pages.
        try {
            if (!asyncAtStart || asyncDispatching) {
                context.getPipeline().getFirst().invoke(request, response);
            } else {
                // Make sure this request/response is here because an error
                // report is required.
                if (!response.isErrorReportRequired()) {
                    throw new IllegalStateException(sm.getString("standardHost.asyncStateError"));
                }
            }
        } catch (Throwable t) {
            ExceptionUtils.handleThrowable(t);
            // If a new error occurred while trying to report a previous
            // error simply log the new error and allow the original error
            // to be reported.
            if (response.isErrorReportRequired()) {
                container.getLogger().error("Exception Processing " + request.getRequestURI(), t);
            } else {
                request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
                throwable(request, response, t);
            }
        }
        Throwable t = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
        // Protect against NPEs if the context was destroyed during a
        // long running request.
        if (!context.getState().isAvailable()) {
            return;
        }
        // Look for (and render if found) an application level error page
        if (response.isErrorReportRequired()) {
            // Error page processing
            response.setSuspended(false);
            if (t != null) {
                throwable(request, response, t);
            } else {
                status(request, response);
            }
        }
        if (!request.isAsync() && !response.isErrorReportRequired()) {
            context.fireRequestDestroyEvent(request);
        }
    } finally {
        // Access a session (if present) to update last accessed time, based
        // on a strict interpretation of the specification
        if (ACCESS_SESSION) {
            request.getSession(false);
        }
        context.unbind(Globals.IS_SECURITY_ENABLED, MY_CLASSLOADER);
    }
}

[Buggy Hunk]
if (!request.isAsync() && !response.isErrorReportRequired()) {

[Patch]
if (!request.isAsync() && (!asyncAtStart || !response.isErrorReportRequired())) {