[Demonstration 1]

[Buggy Method]
@AdminValid
@PutMapping("/configs/{cid}")
public ResponseEntity updateConfig(@PathVariable int cid, @RequestBody UpdateConfigRequest request) {
    Config config = configRepository.findOne(cid);
    if (config == null) {
        return ResponseEntity.notFound().build();
    }
    config.setName(request.name);
    config.setDescription(request.description);
    config.setExpression(request.expression);
    configRepository.save(config);
    return ResponseEntity.ok().build();
}

[Buggy Hunk]
return ResponseEntity.ok().build();

[Patch]
return ResponseEntity.ok("修改成功");

[Demonstration 2]

[Buggy Method]
public List<Product> getRecommendationsForCustomer(String customerId) {
    log.info("getRecommendationsForCustomer for: {}", customerId);
    List<Product> recommendations = null;
    String serviceEndPoint = getBaseServiceUrl(env) + GET_RECOMMENDATIONS_URI + customerId;
    log.info("getCategories: Service End point: {}", serviceEndPoint);
    try {
        ResponseEntity<List<Product>> response = getRestTemplate().exchange(serviceEndPoint, HttpMethod.GET, null, new ParameterizedTypeReference<List<Product>>() {
        });
        recommendations = response.getBody();
    } catch (Exception e) {
        log.error("Error while getting recommendations for: {}!", customerId, e);
    }
    log.info("Recommendations:: {}", recommendations);
    return recommendations;
}

[Buggy Hunk]
String serviceEndPoint = getBaseServiceUrl(env) + GET_RECOMMENDATIONS_URI + customerId;

[Patch]
String serviceEndPoint = getBaseServiceUrl(env) + GET_RECOMMENDATIONS_URI + customerId + "/";

[Demonstration 3]

[Buggy Method]
public void removeMail() {
    Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    String value = params.get("value");
    LOGGER.trace("Removing mail: " + value);
    for (MailaddressDto address : bean.getPerson().getAdditionalMails()) {
        if (value.equals(address.getValue())) {
            bean.getPerson().getAdditionalMails().remove(address);
            LOGGER.trace("Mail removed: " + value);
        }
    }
}

[Buggy Hunk]
String value = params.get("value");

[Patch]
String value = params.get(PARAM_VALUE);