[Demonstration 1]

[Buggy Method]
private void drawFirstLine(Canvas canvas) {
    switch(lastState) {
        case COMPLETE:
            mPaint.setColor(mMarkColor2);
            break;
        case INACTIVE:
        case ACTIVE:
            mPaint.setColor(mStrokeColor);
            break;
    }
    switch(mDirectionStyle) {
        case TimeLineView.HORIZONTAL:
            float localEndX = getPaddingLeft() + stroke1AnimatorValue * (mCenterPointer.x - getPaddingLeft()) - markerAnimatorValue * (mRadius - mStrokeWidth);
            canvas.drawLine(getPaddingLeft(), mCenterPointer.y, localEndX, mCenterPointer.y, mPaint);
            break;
        case TimeLineView.VERTICAL:
            float localEndY = getPaddingTop() + stroke1AnimatorValue * (mCenterPointer.y - getPaddingLeft()) - markerAnimatorValue * (mRadius - mStrokeWidth);
            canvas.drawLine(mCenterPointer.x, getPaddingTop(), mCenterPointer.x, localEndY, mPaint);
            break;
    }
}

[Buggy Hunk]
mPaint.setColor(mMarkColor2);

[Patch]
mPaint.setColor(mCircleSmallActColor);

[Demonstration 2]

[Buggy Method]
public static DBCursor getProductCursor(MongoDBClient mongoClient, String city, List<Integer> categoryList, boolean todayOnly, boolean gpsQuery, double latitude, double longitude, double maxDistance, int sortBy, int startOffset, int maxCount) {
    DBObject query = new BasicDBObject();
    DBObject orderBy = new BasicDBObject();
    // set query
    addCityIntoQuery(query, city);
    addCategoryIntoQuery(query, categoryList);
    addExpirationIntoQuery(query);
    if (gpsQuery) {
        double degreeDistance = maxDistance * 1000 / 6371;
        addGpsIntoQuery(query, longitude, latitude, degreeDistance);
    }
    if (todayOnly) {
        addTodayIntoQuery(query);
    }
    // set order by
    // if (!gpsQuery){
    switch(sortBy) {
        case DBConstants.SORT_BY_PRICE:
            addFieldIntoOrder(orderBy, DBConstants.F_PRICE, true);
            break;
        case DBConstants.SORT_BY_REBATE:
            {
                addNonZeroPriceIntoQuery(query);
                addFieldIntoOrder(orderBy, DBConstants.F_REBATE, true);
            }
            break;
        case DBConstants.SORT_BY_BOUGHT:
            {
                addNonZeroPriceIntoQuery(query);
                addFieldIntoOrder(orderBy, DBConstants.F_BOUGHT, false);
            }
            break;
    }
    addFieldIntoOrder(orderBy, DBConstants.F_START_DATE, false);
    // }
    log.info("<getProducts> query = " + query.toString() + " , orderBy = " + orderBy + " startOffset = " + startOffset + ", maxCount = " + maxCount);
    DBCursor cursor = mongoClient.find(DBConstants.T_PRODUCT, query, orderBy, startOffset, maxCount);
    return cursor;
}

[Buggy Hunk]
double degreeDistance = maxDistance * 1000 / 6371;

[Patch]
double degreeDistance = maxDistance / 6371;

[Demonstration 3]

[Buggy Method]
private void init() {
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setColor(Color.WHITE);
    mPaint.setTextSize(72);
    mStrokePaint = new Paint(mPaint);
    mStrokePaint.setStyle(Paint.Style.STROKE);
    mStrokePaint.setStrokeWidth(mStrokeWidth);
    mStrokePaint.setColor(Color.TRANSPARENT);
}

[Buggy Hunk]
mPaint.setColor(Color.WHITE);

[Patch]
mPaint.setColor(mContext.getResources().getColor(R.color.secondaryHeaderColor));