[Demonstration 1]

[Buggy Method]
@RequestMapping(value = "/passedReservations", params = { "search" })
public String searchData(final ModelMap modelMap, final SearchData searchData) {
    List<GenericDAO> dataList = new ArrayList<>();
    Condition condition = trueCondition();
    if (searchData.getResource() != -1) {
        condition = condition.and(RESOURCES.ID.equal(UInteger.valueOf(searchData.getResource())));
    }
    if (searchData.getStartDate() != null) {
        condition = condition.and(RESERVATIONS.START.greaterOrEqual(Timestamp.valueOf(searchData.getStartDate().atStartOfDay())));
    }
    if (searchData.getEndDate() != null) {
        condition = condition.and(RESERVATIONS.START.lessOrEqual(Timestamp.valueOf(searchData.getEndDate().atStartOfDay())));
    }
    List<LocalDateTime> daysList = dateUtil.getDaysBetween(searchData.getStartDate().atTime(0, 0, 0, 0), searchData.getEndDate().atTime(0, 0, 0, 0)).collect(Collectors.toList());
    List<String> days = daysList.stream().map(DateUtil::getFormatedDate).collect(Collectors.toList());
    Result<Record> fetch = dsl.select(count(RESERVATIONS.RESOURCE_ID).as("count")).select(RESERVATIONS.fields()).select(RESOURCES.fields()).from(RESERVATIONS).innerJoin(RESOURCES).on(RESERVATIONS.RESOURCE_ID.equal(RESOURCES.ID)).where(condition).groupBy(RESERVATIONS.RESOURCE_ID, RESERVATIONS.START, RESERVATIONS.END).fetch();
    logger.info(fetch.toString());
    final List<Map> mapList = new ArrayList<>();
    //|id|resource_id|user_id|name|address|nic_number|conact_number|email_address|start|end|created_at|updated_at|id|category_id|name|location|description|created_at|updated_at|
    //|0 |1          |2      |3   |4      |5         |6            |7            |8    |9  |10        |11        |12|13         |14  |15      |16         |17        |18        |
    fetch.stream().forEach(i -> {
        Map<String, Object> map = new HashMap<>();
        List<Integer> data = new ArrayList<>();
        map.put("name", i.getValue(RESOURCES.NAME));
        LocalDateTime startDateTime = i.getValue(RESERVATIONS.START).toLocalDateTime().toLocalDate().atTime(0, 0, 0, 0);
        LocalDateTime endDateTime = i.get(RESERVATIONS.END).toLocalDateTime().toLocalDate().atTime(0, 0, 0, 0);
        dataList.add(new GenericDAO(i.getValue(RESOURCES.NAME), i.getValue(RESOURCES.LOCATION), startDateTime, endDateTime, (Integer) i.getValue(0)));
        daysList.stream().forEach(day -> {
            LocalDateTime dateTime = day.toLocalDate().atTime(0, 0, 0, 0);
            if (startDateTime.equals(dateTime) || endDateTime.equals(dateTime) || (startDateTime.isBefore(dateTime) && endDateTime.isAfter(dateTime))) {
                data.add((Integer) i.getValue(0));
            } else {
                data.add(0);
            }
        });
        map.put("data", data);
        mapList.add(map);
    });
    modelMap.addAttribute("records", dataList);
    modelMap.addAttribute("days", days);
    modelMap.addAttribute("data", mapList);
    return "passedReservations";
}

[Buggy Hunk]
logger.info(fetch.toString());

[Patch]
logger.info("\n"+fetch.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]
private void logProperties() {
    if (!LOG.isDebugEnabled()) {
        return;
    }
    final StringBuilder b = new StringBuilder();
    b.append("TinyPlugz configuration options:\n");
    this.properties.forEach((k, v) -> {
        b.append("\t").append(k);
        if (v != NON_NULL_VALUE) {
            b.append(":\t").append(v);
        }
        b.append("\n");
    });
    LOG.debug(b.toString());
}

[Buggy Hunk]
if (v != NON_NULL_VALUE) {

[Patch]
if (!NON_NULL_VALUE.equals(v)) {