Program: 150847
Project: 150847
Buggy source:
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
synchronized (CommonDetectCalibrationApp.this) {
    if (success) {
      if (controlPanel.isShowPoints()) {
        java.util.List<Point2D_F64> candidates=getCalibrationPoints();
        for (        Point2D_F64 c : candidates) {
          VisualizeFeatures.drawPoint(g2,(int)(scale * c.x + 0.5),(int)(scale * c.y + 0.5),1,Color.RED);
        }
      }
      if (controlPanel.isShowNumbers()) {
        drawNumbers(g2,getCalibrationPoints(),null,scale);
      }
    }
    if (controlPanel.doShowContour) {
      java.util.List<Contour> contour=getContours();
      g2.setStroke(new BasicStroke(1));
      g2.setColor(Color.RED);
      VisualizeBinaryData.renderExternal(contour,scale,g2);
    }
    if (controlPanel.isShowGraph()) {
      renderGraph(g2,scale);
    }
    if (controlPanel.isShowOrder()) {
      renderOrder(g2,scale);
    }
    if (controlPanel.isShowSquares()) {
      FastQueue<Polygon2D_F64> squares=getFoundPolygons();
      for (int i=0; i < squares.size(); i++) {
        Polygon2D_F64 p=squares.get(i);
        if (isInGrids(p))         continue;
        g2.setColor(Color.cyan);
        g2.setStroke(new BasicStroke(4));
        drawPolygon(p,g2,scale);
        g2.setColor(Color.blue);
        g2.setStroke(new BasicStroke(2));
        drawPolygon(p,g2,scale);
        drawCornersInside(g2,scale,p);
      }
    }
    if (controlPanel.isShowGrids()) {
      java.util.List<SquareGrid> grids=getGrids();
      for (int i=0; i < grids.size(); i++) {
        SquareGrid g=grids.get(i);
        int a=grids.size() == 1 ? 0 : 255 * i / (grids.size() - 1);
        int rgb=a << 16 | (255 - a) << 8;
        g2.setStroke(new BasicStroke(3));
        Color color=new Color(rgb);
        for (int j=0; j < g.nodes.size(); j++) {
          SquareNode n=g.nodes.get(j);
          if (n == null)           continue;
          g2.setColor(color);
          VisualizeShapes.drawPolygon(n.corners,true,scale,g2);
          drawCornersInside(g2,scale,n.corners);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (CommonDetectCalibrationApp.this) {
    if (success) {
      if (controlPanel.isShowPoints()) {
        java.util.List<Point2D_F64> candidates=getCalibrationPoints();
        for (        Point2D_F64 c : candidates) {
          VisualizeFeatures.drawPoint(g2,(int)(scale * c.x + 0.5),(int)(scale * c.y + 0.5),1,Color.RED);
        }
      }
      if (controlPanel.isShowNumbers()) {
        drawNumbers(g2,getCalibrationPoints(),null,scale);
      }
    }
    if (controlPanel.doShowContour) {
      java.util.List<Contour> contour=getContours();
      g2.setStroke(new BasicStroke(1));
      g2.setColor(Color.RED);
      VisualizeBinaryData.renderExternal(contour,scale,g2);
    }
    if (controlPanel.isShowGraph()) {
      renderGraph(g2,scale);
    }
    if (controlPanel.isShowOrder()) {
      renderOrder(g2,scale);
    }
    if (controlPanel.isShowSquares()) {
      FastQueue<Polygon2D_F64> squares=getFoundPolygons();
      for (int i=0; i < squares.size(); i++) {
        Polygon2D_F64 p=squares.get(i);
        if (isInGrids(p))         continue;
        g2.setColor(Color.cyan);
        g2.setStroke(new BasicStroke(4));
        drawPolygon(p,g2,scale);
        g2.setColor(Color.blue);
        g2.setStroke(new BasicStroke(2));
        drawPolygon(p,g2,scale);
        drawCornersInside(g2,scale,p);
      }
    }
    if (controlPanel.isShowGrids()) {
      java.util.List<SquareGrid> grids=getGrids();
      for (int i=0; i < grids.size(); i++) {
        SquareGrid g=grids.get(i);
        int a=grids.size() == 1 ? 0 : 255 * i / (grids.size() - 1);
        int rgb=a << 16 | (255 - a) << 8;
        g2.setStroke(new BasicStroke(3));
        Color color=new Color(rgb);
        for (int j=0; j < g.nodes.size(); j++) {
          SquareNode n=g.nodes.get(j);
          if (n == null)           continue;
          g2.setColor(color);
          VisualizeShapes.drawPolygon(n.corners,true,scale,g2);
          drawCornersInside(g2,scale,n.corners);
        }
      }
    }
  }
}