[Demonstration 1]

[Buggy Method]
@Transactional(value = "hibernateTransactionManager", readOnly = true)
public ResponseEntity<byte[]> getUsersPdf() {
    HttpHeaders headers = new HttpHeaders();
    headers.setContentDispositionFormData("attachment", "users.pdf");
    headers.setContentType(MediaType.TEXT_HTML);
    try {
        Template template = getTemplate("users.ftl");
        Map<String, List<User>> map = new HashMap<String, List<User>>();
        map.put("users", getAllUsersWithAuthorities());
        String html = getHtml(template, map);
        return new ResponseEntity<byte[]>(convertHtmlToPdf(html), headers, HttpStatus.CREATED);
    } catch (IOException e) {
        e.printStackTrace();
    } catch (TemplateException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    return new ResponseEntity<byte[]>(HttpStatus.NO_CONTENT);
}

[Buggy Hunk]
headers.setContentType(MediaType.TEXT_HTML);

[Patch]
headers.setContentType(MediaType.APPLICATION_XHTML_XML);

[Demonstration 2]

[Buggy Method]
@GET
@Path("/get")
@Produces(MediaType.APPLICATION_JSON)
public Response getResults(@HeaderParam("X-Api-Key") String apiKey, @HeaderParam("X-Access-Token") String accessToken, @QueryParam("input") String input) {
    try {
        final String path = "/result/get";
        if (!auth(apiKey, accessToken)) {
            return build(Status.FORBIDDEN);
        } else {
            CBR cbr = new CBR();
            ArrayList<Judgement> resultList = cbr.startCBR(input);
            return build(Status.OK, resultList, path);
        }
    } catch (Exception e) {
        e.printStackTrace();
        return build(Status.INTERNAL_SERVER_ERROR);
    }
}

[Buggy Hunk]
ArrayList<Judgement> resultList = cbr.startCBR(input);

[Patch]
ArrayList<Result> resultList = cbr.startCBR(input);

[Demonstration 3]

[Buggy Method]
public boolean isDirectoryExists(String path) {
    try {
        return getClient().isDirectoryExists("", path);
    } catch (TException e) {
        e.printStackTrace();
    }
    return false;
}

[Buggy Hunk]
return getClient().isDirectoryExists("", path);

[Patch]
return getClient().directoryExists("", path);