Program: 112493
Project: 112493
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  mInnerRectF.set(0,0,mViewSize,mViewSize);
  mInnerRectF.offset((getWidth() - mViewSize) / 2,(getHeight() - mViewSize) / 2);
  final int halfBorder=(int)(mStrokePaint.getStrokeWidth() / 2f + 0.5f);
  mInnerRectF.inset(halfBorder,halfBorder);
  float centerX=mInnerRectF.centerX();
  float centerY=mInnerRectF.centerY();
  canvas.drawArc(mInnerRectF,0,360,true,mBackgroundPaint);
switch (mProgressFillType) {
case FILL_TYPE_RADIAL:
    float sweepAngle=360 * mProgress / mMax;
  canvas.drawArc(mInnerRectF,mStartAngle,sweepAngle,true,mProgressPaint);
break;
case FILL_TYPE_CENTER:
float radius=(mViewSize / 2) * ((float)mProgress / mMax);
canvas.drawCircle(centerX,centerY,radius + 0.5f - mStrokePaint.getStrokeWidth(),mProgressPaint);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + mProgressFillType);
}
if (!TextUtils.isEmpty(mText) && mShowText) {
if (!TextUtils.isEmpty(mTypeface)) {
Typeface typeface=sTypefaceCache.get(mTypeface);
if (null == typeface && null != getResources()) {
AssetManager assets=getResources().getAssets();
if (null != assets) {
typeface=Typeface.createFromAsset(assets,mTypeface);
sTypefaceCache.put(mTypeface,typeface);
}
}
mTextPaint.setTypeface(typeface);
}
int xPos=(int)centerX;
int yPos=(int)(centerY - (mTextPaint.descent() + mTextPaint.ascent()) / 2);
canvas.drawText(mText,xPos,yPos,mTextPaint);
}
if (null != mImage && mShowImage) {
int drawableSize=mImage.getIntrinsicWidth();
mImageRect.set(0,0,drawableSize,drawableSize);
mImageRect.offset((getWidth() - drawableSize) / 2,(getHeight() - drawableSize) / 2);
mImage.setBounds(mImageRect);
mImage.draw(canvas);
}
if (mShowStroke) {
canvas.drawOval(mInnerRectF,mStrokePaint);
}
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  mInnerRectF.set(0,0,mViewSize,mViewSize);
  mInnerRectF.offset((getWidth() - mViewSize) / 2,(getHeight() - mViewSize) / 2);
  if (mShowStroke) {
    final int halfBorder=(int)(mStrokePaint.getStrokeWidth() / 2f + 0.5f);
    mInnerRectF.inset(halfBorder,halfBorder);
  }
  float centerX=mInnerRectF.centerX();
  float centerY=mInnerRectF.centerY();
  canvas.drawArc(mInnerRectF,0,360,true,mBackgroundPaint);
switch (mProgressFillType) {
case FILL_TYPE_RADIAL:
    float sweepAngle=360 * mProgress / mMax;
  canvas.drawArc(mInnerRectF,mStartAngle,sweepAngle,true,mProgressPaint);
break;
case FILL_TYPE_CENTER:
float radius=(mViewSize / 2) * ((float)mProgress / mMax);
if (mShowStroke) {
radius=radius + 0.5f - mStrokePaint.getStrokeWidth();
}
canvas.drawCircle(centerX,centerY,radius,mProgressPaint);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + mProgressFillType);
}
if (!TextUtils.isEmpty(mText) && mShowText) {
if (!TextUtils.isEmpty(mTypeface)) {
Typeface typeface=sTypefaceCache.get(mTypeface);
if (null == typeface && null != getResources()) {
AssetManager assets=getResources().getAssets();
if (null != assets) {
typeface=Typeface.createFromAsset(assets,mTypeface);
sTypefaceCache.put(mTypeface,typeface);
}
}
mTextPaint.setTypeface(typeface);
}
int xPos=(int)centerX;
int yPos=(int)(centerY - (mTextPaint.descent() + mTextPaint.ascent()) / 2);
canvas.drawText(mText,xPos,yPos,mTextPaint);
}
if (null != mImage && mShowImage) {
int drawableSize=mImage.getIntrinsicWidth();
mImageRect.set(0,0,drawableSize,drawableSize);
mImageRect.offset((getWidth() - drawableSize) / 2,(getHeight() - drawableSize) / 2);
mImage.setBounds(mImageRect);
mImage.draw(canvas);
}
if (mShowStroke) {
canvas.drawOval(mInnerRectF,mStrokePaint);
}
}