Program: 9026
Project: 9026
Buggy source:
@Override protected void onDraw(Canvas canvas){
  boolean changed=mChanged;
  if (changed) {
    mChanged=false;
  }
  int availableWidth=getRight() - getLeft();
  int availableHeight=getBottom() - getTop();
  int x=availableWidth / 2;
  int y=availableHeight / 2;
  int w=getWidth();
  int h=getHeight();
  boolean scaled=false;
  if (availableWidth < w || availableHeight < h) {
    scaled=true;
    float scale=min(availableWidth / (float)w,(float)availableHeight / h);
    canvas.save();
    canvas.scale(scale,scale,x,y);
  }
  canvas.save();
  if (mIsProgressSetViaApi) {
    markPointX=mCircleCenterX - (float)(mOuterRadius * cos(toRadians((mProgress * 360.0d / mMaxProgress) + 90.0d)));
    markPointY=mCircleCenterY - (float)(mOuterRadius * sin(toRadians((mProgress * 360.0d / mMaxProgress) + 90.0d)));
  }
  mMarkerPositionX=getXFromAngle();
  mMarkerPositionY=getYFromAngle();
  canvas.drawCircle(mCircleCenterX,mCircleCenterY,mOuterRadius,mCirclePaint);
  drawMarkerAtProgress(canvas);
  if (mIsProgressSetViaApi) {
    mAngle=mProgress * 360.0f / mMaxProgress;
  }
  canvas.rotate(mProgress * 360.0f / mMaxProgress,x,y);
  final Drawable hourHand=mHourHand;
  if (changed) {
    w=hourHand.getIntrinsicWidth();
    h=hourHand.getIntrinsicHeight();
    hourHand.setBounds(x - (w / 2),y - (h / 2),x + (w / 2),y + (h / 2));
  }
  hourHand.draw(canvas);
  canvas.restore();
  canvas.save();
  canvas.rotate(0,x,y);
  final Drawable minuteHand=mMinuteHand;
  if (changed) {
    w=minuteHand.getIntrinsicWidth();
    h=minuteHand.getIntrinsicHeight();
    minuteHand.setBounds(x - (w / 2),y - (h / 2),x + (w / 2),y + (h / 2));
  }
  minuteHand.draw(canvas);
  canvas.restore();
  if (scaled) {
    canvas.restore();
  }
  super.onDraw(canvas);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  boolean changed=mChanged;
  if (changed) {
    mChanged=false;
  }
  int availableWidth=getRight() - getLeft();
  int availableHeight=getBottom() - getTop();
  int x=availableWidth / 2;
  int y=availableHeight / 2;
  int w=getWidth();
  int h=getHeight();
  boolean scaled=false;
  if (availableWidth < w || availableHeight < h) {
    scaled=true;
    float scale=min(availableWidth / (float)w,(float)availableHeight / h);
    canvas.save();
    canvas.scale(scale,scale,x,y);
  }
  canvas.save();
  if (mIsProgressSetViaApi) {
    markPointX=mCircleCenterX - (float)(mOuterRadius * cos(toRadians((mProgress * 360.0d / mMaxProgress) + 90.0d)));
    markPointY=mCircleCenterY - (float)(mOuterRadius * sin(toRadians((mProgress * 360.0d / mMaxProgress) + 90.0d)));
  }
  mMarkerPositionX=getXFromAngle();
  mMarkerPositionY=getYFromAngle();
  canvas.drawCircle(mCircleCenterX,mCircleCenterY,mOuterRadius,mCirclePaint);
  drawMarkerAtProgress(canvas);
  canvas.rotate(mProgress * 360.0f / mMaxProgress,x,y);
  final Drawable hourHand=mHourHand;
  if (changed) {
    w=hourHand.getIntrinsicWidth();
    h=hourHand.getIntrinsicHeight();
    hourHand.setBounds(x - (w / 2),y - (h / 2),x + (w / 2),y + (h / 2));
  }
  hourHand.draw(canvas);
  canvas.restore();
  canvas.save();
  canvas.rotate(0,x,y);
  final Drawable minuteHand=mMinuteHand;
  if (changed) {
    w=minuteHand.getIntrinsicWidth();
    h=minuteHand.getIntrinsicHeight();
    minuteHand.setBounds(x - (w / 2),y - (h / 2),x + (w / 2),y + (h / 2));
  }
  minuteHand.draw(canvas);
  canvas.restore();
  if (scaled) {
    canvas.restore();
  }
  super.onDraw(canvas);
}