[Demonstration 1]

[Buggy Method]
@Override
public void onSuccess(ArrayList<ResourceDTO> result) {
    if (result != null) {
        if (role.equals("READER")) {
            addItem("ALL", "-1");
        }
        int i = 0;
        for (ResourceDTO s : result) {
            rsrclist.add(s.getResourceName());
            rsrcIDlist.add(s.getIdResource());
            addItem(s.getResourceName(), "(" + s.getIdResource().toString() + ")");
            if (s.getResourceName().equalsIgnoreCase(Cookies.getCookie(MyTermCookiesNamespace.Resource))) {
                i = result.indexOf(s);
            }
        }
        setSelectedIndex(i);
    }
}

[Buggy Hunk]
addItem(s.getResourceName(), "("+s.getIdResource().toString()+")");

[Patch]
addItem(s.getResourceName(), s.getIdResource().toString());

[Demonstration 2]

[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));

[Demonstration 3]

[Buggy Method]
@Override
public void onReceive(Object message) throws Exception {
    try {
        if (message instanceof GetTasksFromJob) {
            final String jobID = ((GetTasksFromJob) message).getJobID();
            List<String> tasks = tasksPerJob.get(jobID);
            if (tasks == null) {
                tasks = new ArrayList<>();
            }
            getSender().tell(tasks, getSelf());
            return;
        }
        if (message instanceof GetTaskStatesPerJob) {
            final String jobID = ((GetTaskStatesPerJob) message).getJobID();
            final List<String> taskIDs = tasksPerJob.get(jobID);
            final List<TaskState> states = new ArrayList<>();
            if (taskIDs == null) {
                getSender().tell(new ArrayList<>(), getSelf());
                return;
            }
            final Timeout timeout = new Timeout(Duration.create(10, TimeUnit.SECONDS));
            final ActorRef accountantAll = getContext().actorFor("../accountantAll");
            for (final String taskID : taskIDs) {
                final Future<Object> future = Patterns.ask(accountantAll, new GetTaskState(taskID), timeout);
                TaskState taskState = null;
                try {
                    taskState = (TaskState) Await.result(future, timeout.duration());
                } catch (Exception e) {
                    LOG.error("Error: {}", e);
                }
                states.add(taskState);
            }
            getSender().tell(states, getSelf());
            return;
        }
        if (message instanceof AddTasksToJob) {
            final String jobID = ((AddTasksToJob) message).getJobID();
            final List<String> tasksIDs = ((AddTasksToJob) message).getTaskIDs();
            tasksPerJob.put(jobID, tasksIDs);
            return;
        }
        if (message instanceof RemoveJob) {
            final String jobID = ((RemoveJob) message).getJobID();
            final String IP = ((RemoveJob) message).getJobID();
            final ActorRef accountantAll = getContext().actorFor("../accountantAll");
            final ActorRef accountantPerIP = getContext().actorFor("../accountantPerIP");
            List<String> tasks = tasksPerJob.get(jobID);
            if (tasks != null) {
                for (final String taskID : tasks) {
                    accountantAll.tell(new RemoveTask(taskID), getSelf());
                    accountantPerIP.tell(new RemoveTaskFromIP(taskID, IP), getSelf());
                }
            }
            tasksPerJob.remove(jobID);
            return;
        }
        if (message instanceof Clean) {
            LOG.info("Clean map Tasks/Job accountant actor");
            tasksPerJob.clear();
            return;
        }
    } catch (Exception e) {
        //e.printStackTrace();
        LOG.error("Tasks/Job Accountant actor: {}", e.getMessage());
    }
}

[Buggy Hunk]
final String IP = ((RemoveJob) message).getJobID();

[Patch]
final String IP = ((RemoveJob) message).getIP();