[Demonstration 1]

[Buggy Method]
private Object requestGetWithStatus(final String url, final Integer httpStatus, Class type) throws SDKException {
    HttpResponse<JsonNode> jsonResponse = null;
    try {
        // call the api here
        try {
            checkToken();
        } catch (IOException e) {
            e.printStackTrace();
            throw new SDKException("Could not get token");
        }
        log.debug("Executing get on: " + url);
        if (token != null)
            jsonResponse = Unirest.get(url).header("Authorization", bearerToken.replaceAll("\"", "")).asJson();
        else
            jsonResponse = Unirest.get(url).asJson();
        // check response status
        if (httpStatus != null) {
            checkStatus(jsonResponse, httpStatus);
        } else {
            checkStatus(jsonResponse, HttpURLConnection.HTTP_ACCEPTED);
        }
        // return the response of the request
        log.trace("result is: " + jsonResponse.getBody().toString());
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        JsonParser jp = new JsonParser();
        JsonElement je = jp.parse(jsonResponse.getBody().toString());
        String result = gson.toJson(je);
        log.trace("result is: " + result);
        Class<?> aClass = Array.newInstance(type, 1).getClass();
        log.trace("class is: " + aClass);
        return mapper.fromJson(jsonResponse.getBody().toString(), type);
    } catch (UnirestException e) {
        // catch request exceptions here
        throw new SDKException("Could not http-get properly", e);
    } catch (SDKException e) {
        if (jsonResponse.getStatus() == HttpStatus.SC_UNAUTHORIZED) {
            token = null;
            return requestGetWithStatus(url, httpStatus, type);
        } else {
            e.printStackTrace();
            throw new SDKException("Could not authorize", e);
        }
    }
}

[Buggy Hunk]
checkStatus(jsonResponse, HttpURLConnection.HTTP_ACCEPTED);

[Patch]
checkStatus(jsonResponse, HttpURLConnection.HTTP_OK);

[Demonstration 2]

[Buggy Method]
public Result<DoctSearchDetailDto> getPatientReserveDetail(Long reserveItemId) {
    if (reserveItemId == null) {
        return Result.buildInvalidParamResult(ReserveConstants.RESVERVE_FAILURE_MESSAGE);
    }
    PatientReserveItem reserveItem = patientReserveDao.getPatientReserveItemById(reserveItemId);
    if (reserveItem == null) {
        BusinessException bussnessExcpetion = new BusinessException("获取预约明细出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    PatientReserveInfo reserveInfo = patientReserveDao.getPatientReserveInfoById(reserveItem.getReserveId());
    if (reserveInfo == null) {
        BusinessException bussnessExcpetion = new BusinessException("获取预约主表信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    Result<Patient> patientResult = patientApi.getPatientInfoById(reserveInfo.getUserId());
    if (patientResult.getCode() != HttpServletResponse.SC_OK) {
        BusinessException bussnessExcpetion = new BusinessException("获取患者信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    Patient patient = patientResult.getResultData();
    if (patient == null) {
        BusinessException bussnessExcpetion = new BusinessException("获取患者信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    DoctorVisitInfo doctorVisitInfo = doctorVisitDao.getDoctorVisitInfoById(reserveInfo.getVisitId());
    if (doctorVisitInfo == null) {
        BusinessException bussnessExcpetion = new BusinessException("获取出诊信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    Result<HospitalDto> hospitalResult = hospitalApi.innerGetHospital(doctorVisitInfo.getHospitalId());
    if (hospitalResult.getCode() != HttpServletResponse.SC_OK) {
        BusinessException bussnessExcpetion = new BusinessException("获取医院信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    HospitalDto hospitalDto = hospitalResult.getResultData();
    if (hospitalDto == null) {
        BusinessException bussnessExcpetion = new BusinessException("获取医院信息出错");
        return Result.buildBusinessErrorResult(bussnessExcpetion);
    }
    List<PatientReserveImage> reserveImageList = patientReserveDao.getReserveImageByReserveItemId(reserveItemId);
    DoctSearchDetailDto detailVo = new DoctSearchDetailDto();
    detailVo.setUserName(patient.getName());
    detailVo.setBirthday(patient.getBirthday());
    detailVo.setIdCard(patient.getIdCard());
    detailVo.setGender(patient.getGender());
    detailVo.setPhoneNumber(patient.getPhoneNumber());
    detailVo.setHospitalName(hospitalDto.getHospitalName());
    detailVo.setDiseaseDescription(reserveItem.getDiseaseDescription());
    detailVo.setIsAfternoon(reserveItem.getIsAfternoon());
    detailVo.setIsMorning(reserveItem.getIsMorning());
    detailVo.setIsAfternoon(reserveItem.getIsAfternoon());
    detailVo.setReserveId(reserveInfo.getId());
    detailVo.setVisitDate(reserveItem.getVisitDate());
    if (!CollectionUtils.isEmpty(reserveImageList)) {
        List<String> imageUrlList = new ArrayList<String>();
        for (PatientReserveImage image : reserveImageList) {
            imageUrlList.add(image.getImageUrl());
        }
        detailVo.setImageUrlList(imageUrlList);
    }
    return Result.buildSuccessResult(ReserveConstants.RESVERVE_SUCCESS_MESSAGE, detailVo);
}

[Buggy Hunk]
detailVo.setBirthday(patient.getBirthday());

[Patch]
detailVo.setBirthday(patient.getBirthdayStr());

[Demonstration 3]

[Buggy Method]
@OnClick(R.id.btn_Continue)
void onBtnContinueClick() {
    Toast.makeText(this, "Processing This Section", Toast.LENGTH_SHORT).show();
    if (formValidation()) {
        try {
            SaveDraft();
        } catch (JSONException e) {
            e.printStackTrace();
        }
        if (UpdateDB()) {
            Toast.makeText(this, "Starting Next Section", Toast.LENGTH_SHORT).show();
            //                MainApp.deadMembers.add(new MainApp.deadMemberClass(Integer.parseInt(getIntent().getExtras().get("position").toString()),
            //                        dcbid.getText().toString()));
            finish();
            if (!dcbis05.isChecked()) {
                if (!dataFlag) {
                    MainApp.currentStatusCount += 1;
                }
            } else {
                if (MainApp.NoMembersCount != 0) {
                    startActivity(new Intent(this, SectionCActivity.class));
                }
            }
        } else {
            Toast.makeText(this, "Failed to Update Database!", Toast.LENGTH_SHORT).show();
        }
    }
}

[Buggy Hunk]
startActivity(new Intent(this, SectionCActivity.class));

[Patch]
startActivity(new Intent(this, SectionCActivity.class).putExtra("position",position));