Program: 150862
Project: 150862
Buggy source:
protected void renderVisuals(Graphics2D g2,double scale){
  int activeAlg=controlPanel.getSelectedAlgorithm();
  g2.setStroke(new BasicStroke(3));
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  if (controlPanel.contoursVisible) {
    g2.setStroke(new BasicStroke(1));
    g2.setColor(new Color(0,100,0));
    VisualizeBinaryData.renderExternal(contours,scale,g2);
  }
  if (activeAlg == 0) {
    double splitFraction=controlPanel.getSplitFraction();
    double minimumSplitFraction=controlPanel.getMinimumSplitFraction();
    for (    Contour c : contours) {
      List<PointIndex_I32> vertexes=ShapeFittingOps.fitPolygon(c.external,true,splitFraction,minimumSplitFraction,100);
      g2.setColor(Color.RED);
      g2.setStroke(new BasicStroke(2));
      VisualizeShapes.drawPolygon(vertexes,true,scale,g2);
      if (controlPanel.isCornersVisible()) {
        g2.setColor(Color.BLUE);
        g2.setStroke(new BasicStroke(2f));
        for (        PointIndex_I32 p : vertexes) {
          VisualizeFeatures.drawCircle(g2,scale * (p.x + 0.5),scale * (p.y + 0.5),5);
        }
      }
    }
  }
 else   if (activeAlg == 1) {
    for (    Contour c : contours) {
      if (c.external.size() > 10) {
        FitData<EllipseRotated_F64> ellipse=ShapeFittingOps.fitEllipse_I32(c.external,0,false,null);
        g2.setColor(Color.RED);
        g2.setStroke(new BasicStroke(2.5f));
        VisualizeShapes.drawEllipse(ellipse.shape,scale,g2);
      }
      for (      List<Point2D_I32> internal : c.internal) {
        if (internal.size() <= 10)         continue;
        FitData<EllipseRotated_F64> ellipse=ShapeFittingOps.fitEllipse_I32(internal,0,false,null);
        g2.setColor(Color.GREEN);
        g2.setStroke(new BasicStroke(2.5f));
        VisualizeShapes.drawEllipse(ellipse.shape,scale,g2);
      }
    }
  }
}

Fixed version (ground truth):
protected void renderVisuals(Graphics2D g2,double scale){
  int activeAlg=controlPanel.getSelectedAlgorithm();
  g2.setStroke(new BasicStroke(3));
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  if (controlPanel.contoursVisible) {
    g2.setStroke(new BasicStroke(1));
    g2.setColor(new Color(0,100,0));
    VisualizeBinaryData.renderExternal(contours,scale,g2);
  }
  if (activeAlg == 0) {
    double splitFraction=controlPanel.getSplitFraction();
    double minimumSplitFraction=controlPanel.getMinimumSplitFraction();
    for (    Contour c : contours) {
      List<PointIndex_I32> vertexes=ShapeFittingOps.fitPolygon(c.external,true,splitFraction,minimumSplitFraction,100);
      g2.setColor(Color.RED);
      visualizePolygon(g2,scale,vertexes);
      for (      List<Point2D_I32> internal : c.internal) {
        vertexes=ShapeFittingOps.fitPolygon(internal,true,splitFraction,minimumSplitFraction,100);
        g2.setColor(Color.GREEN);
        visualizePolygon(g2,scale,vertexes);
      }
    }
  }
 else   if (activeAlg == 1) {
    for (    Contour c : contours) {
      if (c.external.size() > 10) {
        FitData<EllipseRotated_F64> ellipse=ShapeFittingOps.fitEllipse_I32(c.external,0,false,null);
        g2.setColor(Color.RED);
        g2.setStroke(new BasicStroke(2.5f));
        VisualizeShapes.drawEllipse(ellipse.shape,scale,g2);
      }
      for (      List<Point2D_I32> internal : c.internal) {
        if (internal.size() <= 10)         continue;
        FitData<EllipseRotated_F64> ellipse=ShapeFittingOps.fitEllipse_I32(internal,0,false,null);
        g2.setColor(Color.GREEN);
        g2.setStroke(new BasicStroke(2.5f));
        VisualizeShapes.drawEllipse(ellipse.shape,scale,g2);
      }
    }
  }
}