[Demonstration 1]

[Buggy Method]
public static void addWarning(String warningMessage, String className) {
    DateField dateField = getDate();
    Label classNameLabel = getClassNameLabel(className);
    Label warningLabel = getMessageLabel(warningMessage, "yellow");
    counter++;
    table.addItem(new Object[] { dateField, classNameLabel, warningLabel }, counter);
    table.setCurrentPageFirstItemId(counter);
}

[Buggy Hunk]
public static void addWarning(String warningMessage, String className) {

[Patch]
public void addWarning(String warningMessage, String className) {

[Demonstration 2]

[Buggy Method]
public void getNewCard() {
    if (!TextUtils.isEmpty(prevKey)) {
        Log.d(TAG, "starCountListener removed");
        databaseReference.child("starCount").child(prevKey).removeEventListener(valueEventListener);
        databaseReference.child("user").child(userId).child("checkedCard").child(prevKey).removeEventListener(starCheckValueEventListener);
        databaseReference.child("comment").child(prevKey).removeEventListener(commentValueEventListener);
    }
    starButton.setClickable(false);
    recordButton.setClickable(false);
    if (null == iterator) {
        return;
    }
    while (iterator.hasNext()) {
        imageLoadingIndicator.show();
        DataSnapshot snapshot = iterator.next();
        CardItem cardItem = snapshot.getValue(CardItem.class);
        // TODO -> 출시 전 count 개수 바꾸기
        if (cardItem.getId().equals(userId) || cardItem.getBlindCount() > 0) {
            continue;
        } else {
            if (!TextUtils.isEmpty(prevKey)) {
                cardLoading.setVisibility(View.VISIBLE);
            }
            //                Log.d(TAG, "cardItem: " + cardItem.toString());
            prevKey = snapshot.getKey();
            storageReference.child("card").child(cardItem.getId() + "/cardImage/" + cardItem.getCardName()).getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {

                @Override
                public void onSuccess(Uri uri) {
                    //                        Log.d(TAG, "cardImage: " + uri);
                    Glide.with(getActivity()).load(uri).thumbnail(0.5f).apply(new RequestOptions().error(R.drawable.ic_loading_error).format(DecodeFormat.DEFAULT).centerInside()).listener(new RequestListener<Drawable>() {

                        @Override
                        public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                            imageLoadingIndicator.hide();
                            cardInfo.setVisibility(View.GONE);
                            cardLoading.startAnimation(fadeOut);
                            swipeRefreshLayout.setRefreshing(false);
                            return false;
                        }

                        @Override
                        public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                            imageLoadingIndicator.hide();
                            cardInfo.setVisibility(View.VISIBLE);
                            cardLoading.startAnimation(fadeOut);
                            swipeRefreshLayout.setRefreshing(false);
                            return false;
                        }
                    }).into(cardImage);
                    if (!TextUtils.isEmpty(prevKey)) {
                        databaseReference.child("user").child(userId).child("checkedCard").child(prevKey).addListenerForSingleValueEvent(starCheckValueEventListener);
                        databaseReference.child("starCount").child(prevKey).addValueEventListener(valueEventListener);
                        Log.d(TAG, "checkedCard / starCountListener added");
                        starButton.setClickable(true);
                        recordButton.setClickable(true);
                        databaseReference.child("comment").child(prevKey).orderByChild("orderKey").limitToFirst(2).addValueEventListener(commentValueEventListener);
                    } else {
                        Glide.with(getActivity()).load(R.drawable.ic_loading_error).apply(new RequestOptions().format(DecodeFormat.DEFAULT).centerInside()).into(cardImage);
                    }
                }
            }).addOnFailureListener(new OnFailureListener() {

                @Override
                public void onFailure(@NonNull Exception e) {
                    Log.d(TAG, "cardImage: " + e);
                    cardLoading.startAnimation(fadeOut);
                }
            });
            return;
        }
    }
    prevKey = null;
    imageLoadingIndicator.hide();
    cardLoading.startAnimation(fadeOut);
    cardInfo.setVisibility(View.GONE);
    starButton.setClickable(false);
    recordButton.setClickable(false);
    swipeRefreshLayout.setRefreshing(false);
    starButton.setImageResource(R.drawable.ic_unstar);
    Glide.with(getActivity()).load(R.drawable.ic_loading_error).apply(new RequestOptions().format(DecodeFormat.DEFAULT).centerInside()).into(cardImage);
    multipleReplyLayout.setVisibility(View.INVISIBLE);
    singleReplyLayout.setVisibility(View.VISIBLE);
    //singlePlayButton.setVisibility(View.INVISIBLE);
    singleComment.setHint("새로운 카드가 없어요!");
    sweetAlertDialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.WARNING_TYPE);
    sweetAlertDialog.setTitleText("카드가 없어요!").setContentText("아래로 쓸어 내려 새 카드를 받아 볼까요?").setConfirmText("확인").show();
}

[Buggy Hunk]
if (cardItem.getId().equals(userId) || cardItem.getBlindCount() > 0) {

[Patch]
if (cardItem.getId().equals(userId) || cardItem.getBlindCount() > 10) {

[Demonstration 3]

[Buggy Method]
@RequestMapping(method = GET)
public String get(Model model, @RequestParam(defaultValue = "24") int hours) {
    Collection<String> sensorList = dataDao.getSensorList();
    Map<String, String> latestDataMap = new HashMap<>(sensorList.size());
    Map<String, List<DataRow>> dataMap = new HashMap<>(sensorList.size());
    Map<String, String> sensorNames = new HashMap<>(sensorList.size());
    sensorList.forEach(uuid -> {
        latestDataMap.put(uuid, dataDao.getLatestData(uuid).getValue());
        dataMap.put(uuid, dataDao.getDataFromLastHours(uuid, hours));
        sensorNames.put(uuid, dataDao.getSensorName(uuid).orElse(uuid));
    });
    model.addAttribute("interval", getInterval(hours));
    model.addAttribute("dataMap", dataMap);
    model.addAttribute("latestDataMap", latestDataMap);
    model.addAttribute("sensorNames", sensorNames);
    model.addAttribute("widgetParameters", widgetParametersDao.getWidgetParams("1"));
    return "index";
}

[Buggy Hunk]
model.addAttribute("widgetParameters", widgetParametersDao.getWidgetParams("1"));

[Patch]
model.addAttribute("widgetParameters", widgetParametersDao.getWidgetParams(1));