[Demonstration 1]

[Buggy Method]
private void generateFrameLayout() {
    int currentOffset = 0;
    for (Node n : nodeList) {
        firm.Mode mode = n.getMode();
        if (mode == firm.Mode.getIs() || mode == firm.Mode.getBs() || mode == firm.Mode.getP()) {
            frameSlots.put(n, currentOffset);
            currentOffset += 8;
        }
    }
    frameSize = currentOffset;
}

[Buggy Hunk]
if (mode == firm.Mode.getIs() || mode == firm.Mode.getBs() || mode == firm.Mode.getP()) {

[Patch]
if (mode.equals(firm.Mode.getIs()) || mode.equals(firm.Mode.getBs()) || mode.equals(firm.Mode.getP())) {

[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]
protected void subscribe() {
    subscription = subject.getRecordsFromService(1).subscribe(new Observer<RecordsWithPagination>() {

        @Override
        public void onCompleted() {
            Log.d(TAG, "onCompleted()");
            notifyItemRemoved(recordList.size());
        }

        @Override
        public void onError(Throwable e) {
            Log.e(TAG, "onError() " + e.getMessage());
            errorPresenter.onError(e);
        }

        @Override
        public void onNext(RecordsWithPagination recordsWithPagination) {
            int range = recordList.size();
            for (Record record : recordsWithPagination.getRecords()) {
                Log.d(TAG, "onNext(" + record.getInstance_id() + ")");
                recordList.add(record);
            }
            notifyItemRangeInserted(range, recordList.size() - 1);
        }
    });
}

[Buggy Hunk]
notifyItemRangeInserted(range, recordList.size() - 1);

[Patch]
notifyItemRangeInserted(range, recordsWithPagination.getRecords().size());