Program: 175692
Project: 175692
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (innerLineHeight <= 0) {
    innerLineHeight=radius * 2 / 3;
  }
  if (triangleHeight <= 0)   triangleHeight=innerLineHeight;
  if (triangleWidth <= 0) {
    int t2=triangleHeight * triangleHeight;
    triangleWidth=(int)Math.sqrt(t2 - (t2 / 4));
  }
  if (innerLineHeight >= radius * 2)   innerLineHeight=radius * 2;
  if (innerLineWidth >= radius)   innerLineWidth=radius;
  if (triangleWidth >= radius)   triangleWidth=radius;
  if (triangleHeight > radius * 2)   triangleHeight=radius * 2;
  float ry=triangleRadius / 2;
  float rx=(float)Math.sqrt(triangleRadius * triangleRadius - ry * ry);
  int halfW=triangleWidth / 2;
  coordinate[0][0]=centerX - halfW;
  coordinate[0][1]=centerY;
  coordinate[1][0]=(centerX - halfW) + rx;
  coordinate[1][1]=centerY - ry;
  coordinate[8][0]=coordinate[1][0];
  coordinate[8][1]=centerY + ry;
  coordinate[3][0]=centerX + halfW;
  coordinate[3][1]=centerY - triangleHeight / 2;
  coordinate[2][0]=(centerX + halfW) - rx;
  coordinate[2][1]=centerY - (triangleHeight / 2 - ry);
  coordinate[7][0]=coordinate[2][0];
  coordinate[7][1]=centerY + (triangleHeight / 2 - ry);
  coordinate[6][0]=coordinate[3][0];
  coordinate[6][1]=centerY + triangleHeight / 2;
  coordinate[4][0]=centerX + halfW;
  coordinate[4][1]=centerY - (triangleHeight / 2 - triangleRadius);
  coordinate[5][0]=coordinate[4][0];
  coordinate[5][1]=centerY + (triangleHeight / 2 - triangleRadius);
  double a2=triangleWidth * triangleWidth;
  double c2=triangleHeight * triangleHeight / 4;
  double c=triangleHeight / 2;
  double a=triangleWidth;
  double x=(Math.pow(Math.sqrt(a2 + c2) - c,2) + a2) / (2 * a);
  double tr=(x - halfW) - (distance + innerLineWidth) / 2;
  for (int i=0; i < coordinate.length; i++) {
    coordinate[i][0]-=tr;
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (innerLineHeight <= 0 || innerLineWidth <= 0) {
    innerLineHeight=0;
    innerLineWidth=0;
  }
  if (triangleHeight <= 0)   triangleHeight=radius * 2 / 3;
  if (triangleWidth <= 0) {
    int t2=triangleHeight * triangleHeight;
    triangleWidth=(int)Math.sqrt(t2 - (t2 / 4));
  }
  if (innerLineHeight >= radius * 2)   innerLineHeight=radius * 2;
  if (innerLineWidth >= radius)   innerLineWidth=radius;
  if (triangleWidth >= radius)   triangleWidth=radius;
  if (triangleHeight > radius * 2)   triangleHeight=radius * 2;
  float ry=triangleRadius / 2;
  float rx=(float)Math.sqrt(triangleRadius * triangleRadius - ry * ry);
  int halfW=triangleWidth / 2;
  coordinate[0][0]=centerX - halfW;
  coordinate[0][1]=centerY;
  coordinate[1][0]=(centerX - halfW) + rx;
  coordinate[1][1]=centerY - ry;
  coordinate[8][0]=coordinate[1][0];
  coordinate[8][1]=centerY + ry;
  coordinate[3][0]=centerX + halfW;
  coordinate[3][1]=centerY - triangleHeight / 2;
  coordinate[2][0]=(centerX + halfW) - rx;
  coordinate[2][1]=centerY - (triangleHeight / 2 - ry);
  coordinate[7][0]=coordinate[2][0];
  coordinate[7][1]=centerY + (triangleHeight / 2 - ry);
  coordinate[6][0]=coordinate[3][0];
  coordinate[6][1]=centerY + triangleHeight / 2;
  coordinate[4][0]=centerX + halfW;
  coordinate[4][1]=centerY - (triangleHeight / 2 - triangleRadius);
  coordinate[5][0]=coordinate[4][0];
  coordinate[5][1]=centerY + (triangleHeight / 2 - triangleRadius);
  double a2=triangleWidth * triangleWidth;
  double c2=triangleHeight * triangleHeight / 4;
  double c=triangleHeight / 2;
  double a=triangleWidth;
  double x=(Math.pow(Math.sqrt(a2 + c2) - c,2) + a2) / (2 * a);
  double tr=(x - halfW) - (distance + innerLineWidth) / 2;
  for (int i=0; i < coordinate.length; i++) {
    coordinate[i][0]-=tr;
  }
}