Program: 58006
Project: 58006
Buggy source:
private void renderFlexibleArch(GL2 gl){
  if (connectionRenderer == null)   return;
  if (!isVertical)   return;
  float leftCenterBrickTop=0;
  float leftCenterBrickBottom=0;
  float rightCenterBrickTop=0;
  float rightCenterBrickBottom=0;
  float curveOffset=x * 0.2f;
  float xStart;
  float xEnd;
  if (leftDimGroup == null && rightDimGroup == null && glVisBricks != null) {
    leftCenterBrickBottom=glVisBricks.getArchBottomY();
    leftCenterBrickTop=glVisBricks.getArchTopY();
    rightCenterBrickBottom=glVisBricks.getArchBottomY();
    rightCenterBrickTop=glVisBricks.getArchTopY();
  }
  if (leftDimGroup != null) {
    GLBrick leftCenterBrick=leftDimGroup.getCenterBrick();
    ElementLayout layout=leftCenterBrick.getLayout();
    leftCenterBrickBottom=layout.getTranslateY();
    leftCenterBrickTop=layout.getTranslateY() + layout.getSizeScaledY();
    xStart=leftDimGroup.getLayout().getTranslateX() - leftCenterBrick.getLayout().getTranslateX();
    if (xStart != 0) {
      connectionRenderer.renderSingleBand(gl,new float[]{xStart,leftCenterBrickTop,0},new float[]{xStart,leftCenterBrickBottom,0},new float[]{0,leftCenterBrickTop,0},new float[]{0,leftCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
    }
  }
 else {
    if (rightDimGroup != null) {
      leftCenterBrickBottom=glVisBricks.getArchBottomY();
      leftCenterBrickTop=glVisBricks.getArchTopY();
      curveOffset=0.1f;
    }
  }
  if (rightDimGroup != null) {
    GLBrick rightCenterBrick=rightDimGroup.getCenterBrick();
    ElementLayout layout=rightCenterBrick.getLayout();
    rightCenterBrickBottom=layout.getTranslateY();
    rightCenterBrickTop=layout.getTranslateY() + layout.getSizeScaledY();
    xEnd=x + rightCenterBrick.getLayout().getTranslateX() - rightDimGroup.getLayout().getTranslateX();
    if (xEnd != 0) {
      connectionRenderer.renderStraightBand(gl,new float[]{x,rightCenterBrickTop,0},new float[]{x,rightCenterBrickBottom,0},new float[]{xEnd,rightCenterBrickTop,0},new float[]{xEnd,rightCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
    }
  }
 else {
    if (leftDimGroup != null) {
      rightCenterBrickBottom=glVisBricks.getArchBottomY();
      rightCenterBrickTop=glVisBricks.getArchTopY();
      curveOffset=0.1f;
    }
  }
  if (leftCenterBrickBottom == 0 && rightCenterBrickBottom == 0)   return;
  connectionRenderer.renderSingleBand(gl,new float[]{0,leftCenterBrickTop,0},new float[]{0,leftCenterBrickBottom,0},new float[]{x,rightCenterBrickTop,0},new float[]{x,rightCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
}

Fixed version (ground truth):
private void renderFlexibleArch(GL2 gl){
  if (connectionRenderer == null)   return;
  if (!isVertical)   return;
  float leftCenterBrickTop=0;
  float leftCenterBrickBottom=0;
  float rightCenterBrickTop=0;
  float rightCenterBrickBottom=0;
  float curveOffset=x * 0.2f;
  float xStart=0;
  float xEnd;
  if (leftDimGroup == null && rightDimGroup == null && glVisBricks != null) {
    leftCenterBrickBottom=glVisBricks.getArchBottomY();
    leftCenterBrickTop=glVisBricks.getArchTopY();
    rightCenterBrickBottom=glVisBricks.getArchBottomY();
    rightCenterBrickTop=glVisBricks.getArchTopY();
  }
  if (leftDimGroup != null) {
    if (leftDimGroup.isDetailBrickShown() && !leftDimGroup.isExpandLeft())     return;
    GLBrick leftCenterBrick=leftDimGroup.getCenterBrick();
    ElementLayout layout=leftCenterBrick.getLayout();
    leftCenterBrickBottom=layout.getTranslateY();
    leftCenterBrickTop=layout.getTranslateY() + layout.getSizeScaledY();
    if (!leftDimGroup.isDetailBrickShown())     xStart=leftDimGroup.getLayout().getTranslateX() - leftCenterBrick.getLayout().getTranslateX();
    if (xStart != 0) {
      connectionRenderer.renderSingleBand(gl,new float[]{xStart,leftCenterBrickTop,0},new float[]{xStart,leftCenterBrickBottom,0},new float[]{0,leftCenterBrickTop,0},new float[]{0,leftCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
    }
  }
 else {
    if (rightDimGroup != null) {
      leftCenterBrickBottom=glVisBricks.getArchBottomY();
      leftCenterBrickTop=glVisBricks.getArchTopY();
      curveOffset=0.1f;
    }
  }
  if (rightDimGroup != null) {
    if (rightDimGroup.isDetailBrickShown() && rightDimGroup.isExpandLeft())     return;
    GLBrick rightCenterBrick=rightDimGroup.getCenterBrick();
    ElementLayout layout=rightCenterBrick.getLayout();
    rightCenterBrickBottom=layout.getTranslateY();
    rightCenterBrickTop=layout.getTranslateY() + layout.getSizeScaledY();
    if (!rightDimGroup.isDetailBrickShown())     xEnd=x + rightCenterBrick.getLayout().getTranslateX() - rightDimGroup.getLayout().getTranslateX();
 else     xEnd=x + rightCenterBrick.getLayout().getTranslateX();
    if (xEnd != 0) {
      connectionRenderer.renderStraightBand(gl,new float[]{x,rightCenterBrickTop,0},new float[]{x,rightCenterBrickBottom,0},new float[]{xEnd,rightCenterBrickTop,0},new float[]{xEnd,rightCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
    }
  }
 else {
    if (leftDimGroup != null) {
      rightCenterBrickBottom=glVisBricks.getArchBottomY();
      rightCenterBrickTop=glVisBricks.getArchTopY();
      curveOffset=0.1f;
    }
  }
  if (leftCenterBrickBottom == 0 && rightCenterBrickBottom == 0)   return;
  connectionRenderer.renderSingleBand(gl,new float[]{0,leftCenterBrickTop,0},new float[]{0,leftCenterBrickBottom,0},new float[]{x,rightCenterBrickTop,0},new float[]{x,rightCenterBrickBottom,0},false,curveOffset,0,false,new float[]{0,0,0},0.5f);
}