[Demonstration 1]

[Buggy Method]
protected void drawZeroLine(Canvas c) {
    int clipRestoreCount = c.save();
    mZeroLineClippingRect.set(mViewPortHandler.getContentRect());
    mZeroLineClippingRect.inset(0.f, -mYAxis.getZeroLineWidth() / 2.f);
    c.clipRect(mLimitLineClippingRect);
    // draw zero line
    MPPointD pos = mTrans.getPixelForValues(0f, 0f);
    mZeroLinePaint.setColor(mYAxis.getZeroLineColor());
    mZeroLinePaint.setStrokeWidth(mYAxis.getZeroLineWidth());
    Path zeroLinePath = mDrawZeroLinePath;
    zeroLinePath.reset();
    zeroLinePath.moveTo(mViewPortHandler.contentLeft(), (float) pos.y - 1);
    zeroLinePath.lineTo(mViewPortHandler.contentRight(), (float) pos.y - 1);
    // draw a path because lines don't support dashing on lower android versions
    c.drawPath(zeroLinePath, mZeroLinePaint);
    c.restoreToCount(clipRestoreCount);
}

[Buggy Hunk]
c.clipRect(mLimitLineClippingRect);

[Patch]
c.clipRect(mZeroLineClippingRect);

[Demonstration 2]

[Buggy Method]
protected void renderFill(Canvas canvas, List<? extends IPointLine> ptsRender, ISeriesHolder holder, Map<ISeries, ISeriesHolder> holders, Path fPath) {
    Paint fPaint = getFillPaint();
    RectF wndSize = holder.getWindowSize();
    if (fPath == null || fPaint == null || ptsRender == null || ptsRender.isEmpty() || wndSize == null)
        return;
    int cnt = canvas.save();
    canvas.clipRect(wndSize.left, wndSize.top, wndSize.right, wndSize.bottom);
    canvas.clipPath(fPath);
    Drawable drawable;
    if ((drawable = fillDrawable) == null) {
        canvas.drawPaint(fPaint);
    } else {
        drawable.draw(canvas);
    }
    canvas.restoreToCount(cnt);
}

[Buggy Hunk]
Paint fPaint = getFillPaint();

[Patch]
Paint fPaint = getFillPaint(ptsRender, holder, holders);

[Demonstration 3]

[Buggy Method]
@Test
public void loginWrongUsernameTest() {
    onView(withId(R.id.etxtUsername)).perform(typeText("test"), closeSoftKeyboard());
    onView(withId(R.id.etxtPassword)).perform(typeText("test"), closeSoftKeyboard());
    onView(withId(R.id.btnLogin)).perform(click());
    onView(withId(R.id.txtError)).check(matches(withText(R.string.loginFail)));
}

[Buggy Hunk]
onView(withId(R.id.etxtUsername)).perform(typeText("test"),closeSoftKeyboard());

[Patch]
onView(withId(R.id.etxtUsername)).perform(typeText("test"));