Program: 160204
Project: 160204
Buggy source:
@Override protected void onDraw(Canvas canvas){
  this.canvas=canvas;
  super.onDraw(canvas);
  strokewidth=CalculationUtil.convertDpToPx(widthInDp,getContext());
  float scope=canvas.getWidth() + canvas.getHeight() + canvas.getHeight()+ canvas.getWidth() - strokewidth;
  if (isOutline()) {
    drawOutline();
  }
  if (isStartline()) {
    drawStartline();
  }
  if (isShowProgress()) {
    drawPercent(percentSettings);
  }
  if (isCenterline()) {
    drawCenterline(strokewidth);
  }
  if ((isClearOnHundred() && progress == 100.0) || (progress <= 0.0)) {
    return;
  }
  if (isIndeterminate()) {
    Path path=new Path();
    DrawStop drawEnd=getDrawEnd((scope / 100) * Float.valueOf(String.valueOf(indeterminate_count)),canvas);
    if (drawEnd.place == Place.TOP) {
      path.moveTo(drawEnd.location - indeterminate_width - strokewidth,strokewidth / 2);
      path.lineTo(drawEnd.location,strokewidth / 2);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.RIGHT) {
      path.moveTo(canvas.getWidth() - (strokewidth / 2),drawEnd.location - indeterminate_width);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth + drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.BOTTOM) {
      path.moveTo(drawEnd.location - indeterminate_width - strokewidth,canvas.getHeight() - (strokewidth / 2));
      path.lineTo(drawEnd.location,canvas.getHeight() - (strokewidth / 2));
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.LEFT) {
      path.moveTo((strokewidth / 2),drawEnd.location - indeterminate_width - strokewidth);
      path.lineTo((strokewidth / 2),drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    indeterminate_count++;
    if (indeterminate_count > 100) {
      indeterminate_count=0;
    }
    invalidate();
  }
 else {
    Path path=new Path();
    DrawStop drawEnd=getDrawEnd((scope / 100) * Float.valueOf(String.valueOf(progress)),canvas);
    if (drawEnd.place == Place.TOP) {
      if (drawEnd.location > (canvas.getWidth() / 2)) {
        path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
        path.lineTo(drawEnd.location,strokewidth / 2);
      }
 else {
        path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
        path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
        path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
        path.lineTo(strokewidth / 2,canvas.getHeight() - strokewidth / 2);
        path.lineTo(strokewidth / 2,strokewidth / 2);
        path.lineTo(drawEnd.location,strokewidth / 2);
      }
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.RIGHT) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2 + drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.BOTTOM) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
      path.lineTo(drawEnd.location,canvas.getHeight() - (strokewidth / 2));
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.LEFT) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
      path.lineTo(strokewidth / 2,canvas.getHeight() - strokewidth / 2);
      path.lineTo((strokewidth / 2),drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  this.canvas=canvas;
  super.onDraw(canvas);
  strokewidth=CalculationUtil.convertDpToPx(widthInDp,getContext());
  float scope=canvas.getWidth() + canvas.getHeight() + canvas.getHeight()+ canvas.getWidth() - strokewidth;
  if (isOutline()) {
    drawOutline();
  }
  if (isStartline()) {
    drawStartline();
  }
  if (isShowProgress()) {
    drawPercent(percentSettings);
  }
  if (isCenterline()) {
    drawCenterline(strokewidth);
  }
  if ((isClearOnHundred() && progress == 100.0) || (progress <= 0.0)) {
    return;
  }
  if (isIndeterminate()) {
    Path path=new Path();
    DrawStop drawEnd=getDrawEnd((scope / 100) * Float.valueOf(String.valueOf(indeterminate_count)),canvas);
    if (drawEnd.place == Place.TOP) {
      path.moveTo(drawEnd.location - indeterminate_width - strokewidth,strokewidth / 2);
      path.lineTo(drawEnd.location,strokewidth / 2);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.RIGHT) {
      path.moveTo(canvas.getWidth() - (strokewidth / 2),drawEnd.location - indeterminate_width);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth + drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.BOTTOM) {
      path.moveTo(drawEnd.location - indeterminate_width - strokewidth,canvas.getHeight() - (strokewidth / 2));
      path.lineTo(drawEnd.location,canvas.getHeight() - (strokewidth / 2));
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.LEFT) {
      path.moveTo((strokewidth / 2),drawEnd.location - indeterminate_width - strokewidth);
      path.lineTo((strokewidth / 2),drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    indeterminate_count++;
    if (indeterminate_count > 100) {
      indeterminate_count=0;
    }
    invalidate();
  }
 else {
    Path path=new Path();
    DrawStop drawEnd=getDrawEnd((scope / 100) * Float.valueOf(String.valueOf(progress)),canvas);
    if (drawEnd.place == Place.TOP) {
      if (drawEnd.location > (canvas.getWidth() / 2) && progress < 100.0) {
        path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
        path.lineTo(drawEnd.location,strokewidth / 2);
      }
 else {
        path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
        path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
        path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
        path.lineTo(strokewidth / 2,canvas.getHeight() - strokewidth / 2);
        path.lineTo(strokewidth / 2,strokewidth / 2);
        path.lineTo(drawEnd.location,strokewidth / 2);
      }
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.RIGHT) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2 + drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.BOTTOM) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
      path.lineTo(drawEnd.location,canvas.getHeight() - (strokewidth / 2));
      canvas.drawPath(path,progressBarPaint);
    }
    if (drawEnd.place == Place.LEFT) {
      path.moveTo(canvas.getWidth() / 2,strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),strokewidth / 2);
      path.lineTo(canvas.getWidth() - (strokewidth / 2),canvas.getHeight() - strokewidth / 2);
      path.lineTo(strokewidth / 2,canvas.getHeight() - strokewidth / 2);
      path.lineTo((strokewidth / 2),drawEnd.location);
      canvas.drawPath(path,progressBarPaint);
    }
  }
}