[Demonstration 1]

[Buggy Method]
public void renderAll() {
    try {
        Scanner setsFinder = new Scanner(new File("data\\Sets.txt"));
        ArrayList<String> sets = new ArrayList<String>();
        while (setsFinder.hasNextLine()) {
            sets.add(setsFinder.nextLine());
        }
        GridBagConstraints rules = new GridBagConstraints();
        int count = 0;
        for (String set : sets) {
            super.makeButton(set, set, count, 0, 20, rules);
            count++;
        }
    } catch (Exception e) {
    }
}

[Buggy Hunk]
super.makeButton (set, set, count, 0, 20, rules);

[Patch]
makeButton (set, set, count, 0, 20, rules);

[Demonstration 2]

[Buggy Method]
private List<Map<String, String>> getDataList() {
    ArrayList<Map<String, String>> dataList = new ArrayList<Map<String, String>>();
    HashMap<String, String> map;
    SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    map = new HashMap<String, String>();
    map.put("loop", "Loop");
    map.put("device", "Device/Group");
    map.put("serial", "Serial number");
    map.put("location", "Location");
    map.put("description", "Fault description");
    dataList.add(map);
    if (report != null) {
        for (int i = 0; i < report.getFaultyDeviceList().size(); i++) {
            map = new HashMap<String, String>();
            ArrayList<Integer> list = (ArrayList<Integer>) report.getFaultyDeviceList().get(i);
            int address = list.get(0);
            int fs = list.get(1);
            long serialNumber = list.get(2) + 256 * list.get(3) + 65536 * list.get(4) + 16777216L * list.get(5);
            map.put("loop", (address & 0x80) == 0 ? "01" : "02");
            map.put("device", Integer.toString(address & 63));
            map.put("serial", Long.toString(serialNumber));
            map.put("location", "-");
            map.put("description", Device.getFailureStatusText(fs));
            dataList.add(map);
        }
    }
    return dataList;
}

[Buggy Hunk]
ArrayList<Integer> list = (ArrayList<Integer>) report.getFaultyDeviceList().get(i);

[Patch]
List<Integer> list = report.getFaultyDeviceList().get(i);

[Demonstration 3]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));