[Demonstration 1]

[Buggy Method]
@ApiOperation(value = "Re-query a location from an existing query. " + "This runs asynchronously and returns a query object which can later be used to get the results.")
@RequestMapping(path = "/requery/query/{queryId}/locationMap/{queryLocationMapId}", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
@ResponseBody
public Query requeryPatients(@PathVariable("queryId") Long queryId, @PathVariable("queryLocationMapId") Long queryLocationMapId) throws JsonProcessingException, IOException {
    CommonUser user = UserUtil.getCurrentUser();
    //auditManager.addAuditEntry(QueryType.SEARCH_PATIENT, "/search", user.getSubjectName());
    QueryDTO initiatedQuery = searchManager.requeryForPatientRecords(queryLocationMapId, user);
    return DtoToDomainConverter.convert(initiatedQuery);
}

[Buggy Hunk]
public @ResponseBody Query requeryPatients(@PathVariable("queryId") Long queryId,

[Patch]
public synchronized @ResponseBody Query requeryPatients(@PathVariable("queryId") Long queryId,

[Demonstration 2]

[Buggy Method]
@RequestMapping("/")
public String home(Model model, HttpSession httpSession) {
    User user = new User();
    if (httpSession.getAttribute("userId") != null) {
        String id = (String) httpSession.getAttribute("userId");
        user = userRepository.findOne(id);
    }
    List<Article> articleList = (List<Article>) articleRepository.findAll();
    model.addAttribute("user", user);
    model.addAttribute("articles", articleList);
    return "home";
}

[Buggy Hunk]
List<Article> articleList = (List<Article>)articleRepository.findAll();

[Patch]
List<Article> articleList = (List<Article>)articleRepository.findAllOrderByDate();

[Demonstration 3]

[Buggy Method]
public int getYOffset() {
    return mYOffset;
}

[Buggy Hunk]
return mYOffset;

[Patch]
return mUseSystemGravity ? mDefaultGravityParams[PARAM_Y_OFFSET] : mYOffset;