[Demonstration 1]

[Buggy Method]
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    int visibility = savedInstanceState != null ? savedInstanceState.getInt(VISIBILITY, View.VISIBLE) : View.VISIBLE;
    if (visibility == View.GONE) {
        setUser(Json.tryParseJson(savedInstanceState.getString(USER), User.class, new User()));
    } else {
        TrelloAPIUtil.instance.getAsync(TrelloAPIUtil.instance.user(), new UserListener(), new HttpErrorListener(getActivity()));
    }
}

[Buggy Hunk]
new UserListener(), new HttpErrorListener(getActivity()));

[Patch]
new UserListener(), new LoginErrorListener(getActivity()));

[Demonstration 2]

[Buggy Method]
@Override
@RequestMapping(value = "/getListVideoSubscription", method = RequestMethod.GET)
public ResponseEntity<Response> getListVideoSubscription(@RequestParam("userId") final String userId, @RequestParam("subjectId") final String subjectId) {
    SimpleResponse response = null;
    try {
        String method = "getListVideoSubscription()";
        logger.debug(method + " start");
        String entityName = null;
        List<Object> readObject = null;
        String currentDate = "";
        String firstDayOfCurrentWeek = "";
        Object[] queryParams = null;
        Map<String, List<Object>> mapListVideo = new HashMap<String, List<Object>>();
        try {
            Calendar cal = Calendar.getInstance();
            cal.setTime(new Date());
            cal.setFirstDayOfWeek(Calendar.MONDAY);
            cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
            Date firstDayOfTheWeek = cal.getTime();
            currentDate = DateUtil.date2YYYYMMDD000000(new Date());
            firstDayOfCurrentWeek = DateUtil.date2YYYYMMDD000000(firstDayOfTheWeek);
            if ("-2".equals(subjectId)) {
                entityName = SibConstants.SqlMapper.SQL_SIB_GET_ALL_VIDEO_SUBSCRIPTION;
                queryParams = new Object[] { userId, currentDate, userId, firstDayOfCurrentWeek, currentDate, userId };
                readObject = dao.readObjects(entityName, queryParams);
            } else {
                // Get child category by subjectId
                List<Map<String, Object>> readObjectNoCondition = dao.readObjectNoCondition(SibConstants.SqlMapper.SQL_GET_ALL_CATEGORY_TOPIC);
                MapSqlParameterSource params = new MapSqlParameterSource();
                String allChildCategory = CommonUtil.getAllChildCategory(subjectId, readObjectNoCondition);
                if (!StringUtil.isNull(allChildCategory)) {
                    List<Integer> listChildCategory = new ArrayList<Integer>();
                    String[] arrChildCategory = allChildCategory.split(",");
                    for (String string : arrChildCategory) {
                        listChildCategory.add(Integer.parseInt(string));
                    }
                    params.addValue("subjectID", listChildCategory);
                }
                params.addValue("userID", userId);
                params.addValue("currentDate", currentDate);
                params.addValue("firstDayOfCurrentWeek", firstDayOfCurrentWeek);
                entityName = SibConstants.SqlMapper.SQL_SIB_GET_ALL_VIDEO_SUBSCRIPTION_BY_CATEGORY;
                readObject = dao.readObjectNamedParameter(entityName, params);
            }
            if (readObject == null) {
                readObject = new ArrayList<Object>();
            }
            JSONArray jsonAraay = new JSONArray(readObject);
            for (int i = 0; i < jsonAraay.length(); i++) {
                JSONObject jsonObj = jsonAraay.getJSONObject(i);
                ObjectMapper mapper = new ObjectMapper();
                Object obj = mapper.readValue(jsonObj.toString(), Object.class);
                addMapVideo(mapListVideo, jsonObj.get("flag").toString(), obj);
            }
        } catch (ParseException | IOException e) {
            logger.error(method + " - error : " + e.getMessage());
        }
        response = new SimpleResponse("true", mapListVideo);
    } catch (Exception e) {
        e.printStackTrace();
        response = new SimpleResponse(SibConstants.FAILURE, "video", "getListVideoSubscription", e.getMessage());
    }
    return new ResponseEntity<Response>(response, HttpStatus.OK);
}

[Buggy Hunk]
queryParams = new Object[] { userId, currentDate, userId, firstDayOfCurrentWeek, currentDate, userId };

[Patch]
queryParams = new Object[] { userId, currentDate, userId, firstDayOfCurrentWeek, currentDate, userId, firstDayOfCurrentWeek };

[Demonstration 3]

[Buggy Method]
@Override
public Page<Post> getListPost(int pageNumber) {
    return postRepository.findAll(new PageRequest(pageNumber - 1, 10, new Sort(Sort.Direction.DESC, "status")));
}

[Buggy Hunk]
return postRepository.findAll(new PageRequest(pageNumber-1, 10, new Sort(Sort.Direction.DESC, "status")));

[Patch]
return postRepository.findAll(new PageRequest(pageNumber-1, 10));