[Demonstration 1]

[Buggy Method]
public FieldDeclaration getPropertyStructure(String propertyName) throws CannotFindFieldException {
    final FieldDeclaration[] matchedProperty = { null };
    TreeVisitor visitor = new TreeVisitor() {

        @Override
        public void process(Node node) {
            if (FieldDeclaration.class.isInstance(node)) {
                FieldDeclaration property = (FieldDeclaration) node;
                if (property.getVariables().get(0).getId().getName().equals(propertyName)) {
                    matchedProperty[0] = property;
                }
            }
        }
    };
    visitor.visitDepthFirst(this.compilationUnit);
    if (matchedProperty.length == 0) {
        throw new CannotFindFieldException("Cannot find a property named '" + propertyName + "' on class '" + getClassName() + "'.");
    }
    return matchedProperty[0];
}

[Buggy Hunk]
if(matchedProperty.length == 0){

[Patch]
if(matchedProperty[0] == null){

[Demonstration 2]

[Buggy Method]
private static Response sendRedirect(String redirectUri) {
    Response response = new Response();
    // Redirect with a 302 (Found) status code
    response.setStatus(HttpServletResponse.SC_FOUND);
    // Web container was rebasing location header against server URL
    // Not useful if relayState is already (and always) an absolute URL
    response.getHeaders().putSingle(LocationHeader.NAME, redirectUri);
    return response;
}

[Buggy Hunk]
response.setStatus(HttpServletResponse.SC_FOUND);

[Patch]
response.setStatus(Status.FOUND);

[Demonstration 3]

[Buggy Method]
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Set<String> keys = new HashSet<>(Arrays.asList("username", "password"));
    Map<String, String> messages = new HashMap<>();
    Map<String, String> data = new HashMap<>();
    for (String key : keys) {
        String value = request.getParameter(key);
        if (value != null && !value.isEmpty()) {
            data.put(key, value);
        } else {
            messages.put(key, "signIn.message.enter." + key);
        }
    }
    if (messages.size() == 0) {
        if (authorizeInDb(request, messages, data)) {
            //TODO: CONTROLLER
            response.sendRedirect("./clinicalRecordsTableController");
        } else {
            response.sendRedirect("./signIn");
        }
        request.setAttribute(ERROR_MESSAGES_ATTRIBUTE, messages);
        return;
    }
    request.setAttribute(ERROR_MESSAGES_ATTRIBUTE, messages);
    request.getRequestDispatcher("./signIn").forward(request, response);
}

[Buggy Hunk]
response.sendRedirect("./signIn");

[Patch]
request.getRequestDispatcher("./signIn").forward(request, response);