[Demonstration 1]

[Buggy Method]
public void submitLocation(final String name, final String latitude, final String longitude) {
    VolleyServiceGateway volleyService = new VolleyServiceGateway(mContext) {

        @Override
        protected Map<String, String> makeHeaders() {
            HashMap<String, String> headers = new HashMap<>();
            return headers;
        }

        @Override
        protected Map<String, String> getParams() {
            HashMap<String, String> params = new HashMap<>();
            params.put(AppConstants.DATA, name + " is now at " + latitude + "/" + longitude);
            return params;
        }

        @Override
        protected void processResponse(String response) {
        }

        @Override
        protected void processResponseCode(int code) {
            final int statusCode = code;
            mContext.runOnUiThread(new Runnable() {

                public void run() {
                    if (statusCode == 201) {
                        Date startTime = new Date();
                        AppUtils.putStringToPref(mContext, AppConstants.TIME, Long.toString(startTime.getTime()));
                        Toast.makeText(mContext, mContext.getString(R.string.success_submit_location), Toast.LENGTH_SHORT).show();
                    } else {
                        Toast.makeText(mContext, mContext.getString(R.string.failure_submit_location), Toast.LENGTH_SHORT).show();
                    }
                }
            });
        }

        @Override
        protected void processError(VolleyError errorResponse) {
            mEventBus.post(errorResponse);
        }

        @Override
        protected void processNetworkError() {
            mEventBus.post(ErrorType.NO_INTERNET);
        }
    };
    volleyService.postData(AppConstants.SUBMIT_LOCATION_URL);
}

[Buggy Hunk]
protected Map<String, String> getParams() {

[Patch]
protected Map<String, String> getParamsData() {

[Demonstration 2]

[Buggy Method]
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    if (lineChartShader == null)
        return;
    RectF screenChartRect = coordinateSystemsShader.calculateChartCanvasRect();
    float screenWidth = screenChartRect.width();
    float screenHeight = screenChartRect.height();
    fScreenWidth = screenWidth;
    float fUnitXLength = screenWidth / (mScreenCountX_Axis - 1);
    fTotalChartLength = fUnitXLength * (mTotalCountX - 1);
    if (fScreenCurrentPosition == -1) {
        fScreenCurrentPosition = fTotalChartLength;
    }
    float fScreenCurrentEndPos = fScreenCurrentPosition;
    float fScreenCurrentStartPos = fScreenCurrentPosition - screenWidth;
    float startRate = fScreenCurrentStartPos / fUnitXLength;
    mStartIndex = (int) Math.floor(fScreenCurrentStartPos / fUnitXLength);
    float offsetX = mStartIndex * fUnitXLength - fScreenCurrentStartPos;
    coordinateSystemsShader.setContents(mContentX_Axis, mContentY_Axis);
    coordinateSystemsShader.drawData(mStartIndex, mScreenCountX_Axis, offsetX);
    coordinateSystemsShader.shader(canvas);
    int endIndex = mStartIndex + mScreenCountX_Axis;
    if (endIndex < mTotalCountX) {
        endIndex++;
    }
    //计算在当前需要显示的坐标
    List<PointF[]> pointFList = new ArrayList<>();
    List<Integer> colorList = new ArrayList<>();
    for (Line line : mLines) {
        PointF[] pointFs = new PointF[endIndex - mStartIndex];
        for (int i = mStartIndex; i < endIndex; i++) {
            PointF pointF = new PointF();
            pointF.y = screenHeight * (1 - line.getRateYAxis(i));
            pointF.x = (i - mStartIndex) * fUnitXLength + offsetX;
            pointFs[i - mStartIndex] = pointF;
        }
        pointFList.add(pointFs);
        colorList.add(line.getColor());
    }
    lineChartShader.setPoint(pointFList, colorList);
    lineChartShader.shader(canvas);
    for (Toast toast : toastList) {
        if (toast.index - mStartIndex < 0 || toast.index - mStartIndex >= mScreenCountX_Axis)
            continue;
        PointF pointF = lineChartShader.getFixedPoint(toast.lineIndex, toast.index - mStartIndex);
        toast.draw(pointF, canvas);
    }
}

[Buggy Hunk]
if(lineChartShader == null)return;

[Patch]
if(lineChartShader == null || mLines.size()==0)return;