Program: 150627
Project: 150627
Buggy source:
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
  DetectQrCodeControlPanel controls=(DetectQrCodeControlPanel)DetectQrCodeApp.this.controls;
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (DetectQrCodeApp.this) {
    if (controls.bShowContour) {
      LinearContourLabelChang2004 contour=detector.getSquareDetector().getDetector().getContourFinder();
      List<Contour> contours=BinaryImageOps.convertContours(contour.getPackedPoints(),contour.getContours());
      g2.setStroke(new BasicStroke(1));
      VisualizeBinaryData.render(contours,null,Color.CYAN,scale,g2);
    }
    if (controls.bShowMarkers) {
      List<QrCode> detected=detector.getDetections();
      g2.setColor(new Color(0x5011FF00,true));
      for (int i=0; i < detected.size(); i++) {
        QrCode qr=detected.get(i);
        VisualizeShapes.fillPolygon(qr.bounds,scale,g2);
        if (controls.bShowBits)         renderBinaryValues(g2,qr);
      }
      List<QrCode> failures=detector.getFailures();
      for (int i=0; i < failures.size(); i++) {
        QrCode qr=failures.get(i);
        if (qr.failureCause.ordinal() < ALIGNMENT.ordinal())         continue;
switch (qr.failureCause) {
case ERROR_CORRECTION:
          g2.setColor(new Color(0x80FF0000,true));
        break;
case DECODING_MESSAGE:
      g2.setColor(new Color(0x80FF9000,true));
    break;
default :
  g2.setColor(new Color(0x80FF00C0,true));
break;
}
VisualizeShapes.fillPolygon(qr.bounds,scale,g2);
if (controls.bShowBits) renderBinaryValues(g2,qr);
}
}
if (controls.bShowSquares) {
List<Polygon2D_F64> polygons=detector.getSquareDetector().getPolygons(null,null);
g2.setColor(Color.GREEN);
g2.setStroke(new BasicStroke(3));
for (Polygon2D_F64 p : polygons) {
VisualizeShapes.drawPolygon(p,true,scale,g2);
}
}
if (controls.bShowAlignmentPattern) {
List<QrCode> codes=detector.getDetections();
g2.setColor(Color.BLUE);
g2.setStroke(new BasicStroke(3));
for (QrCode qr : codes) {
double size=Math.sqrt(qr.ppCorner.areaSimple()) / 14.0;
for (int i=0; i < qr.alignment.size; i++) {
QrCode.Alignment a=qr.alignment.get(i);
VisualizeFeatures.drawCircle(g2,a.pixel.x * scale,a.pixel.y * scale,size * scale);
}
}
}
if (controls.bShowPositionPattern) {
FastQueue<PositionPatternNode> nodes=detector.getDetectPositionPatterns().getPositionPatterns();
g2.setColor(Color.ORANGE);
g2.setStroke(new BasicStroke(3));
List<SquareEdge> list=new ArrayList<>();
for (int i=0; i < nodes.size(); i++) {
SquareNode n=nodes.get(i);
VisualizeShapes.drawPolygon(n.square,true,scale,g2);
for (int j=0; j < 4; j++) {
if (n.edges[j] != null) {
if (!list.contains(n.edges[j])) {
  list.add(n.edges[j]);
}
}
}
}
g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(new Color(255,150,100));
g2.setStroke(new BasicStroke(3));
Line2D.Double l=new Line2D.Double();
for (int i=0; i < list.size(); i++) {
SquareEdge e=list.get(i);
Point2D_F64 a=e.a.center;
Point2D_F64 b=e.b.center;
l.setLine(scale * a.x,scale * a.y,scale * b.x,scale * b.y);
g2.draw(l);
}
}
}
}

Fixed version (ground truth):
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
  DetectQrCodeControlPanel controls=(DetectQrCodeControlPanel)DetectQrCodeApp.this.controls;
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (DetectQrCodeApp.this) {
    if (controls.bShowContour) {
      LinearContourLabelChang2004 contour=detector.getSquareDetector().getDetector().getContourFinder();
      List<Contour> contours=BinaryImageOps.convertContours(contour.getPackedPoints(),contour.getContours());
      g2.setStroke(new BasicStroke(1));
      VisualizeBinaryData.render(contours,null,Color.CYAN,scale,g2);
    }
    if (controls.bShowMarkers) {
      List<QrCode> detected=detector.getDetections();
      for (int i=0; i < detected.size(); i++) {
        g2.setColor(new Color(0x5011FF00,true));
        QrCode qr=detected.get(i);
        VisualizeShapes.fillPolygon(qr.bounds,scale,g2);
        if (controls.bShowBits)         renderBinaryValues(g2,qr);
      }
      List<QrCode> failures=detector.getFailures();
      for (int i=0; i < failures.size(); i++) {
        QrCode qr=failures.get(i);
        if (qr.failureCause.ordinal() < ALIGNMENT.ordinal())         continue;
switch (qr.failureCause) {
case ERROR_CORRECTION:
          g2.setColor(new Color(0x80FF0000,true));
        break;
case DECODING_MESSAGE:
      g2.setColor(new Color(0x80FF9000,true));
    break;
default :
  g2.setColor(new Color(0x80FF00C0,true));
break;
}
VisualizeShapes.fillPolygon(qr.bounds,scale,g2);
if (controls.bShowBits) renderBinaryValues(g2,qr);
}
}
if (controls.bShowSquares) {
List<Polygon2D_F64> polygons=detector.getSquareDetector().getPolygons(null,null);
g2.setColor(Color.GREEN);
g2.setStroke(new BasicStroke(3));
for (Polygon2D_F64 p : polygons) {
VisualizeShapes.drawPolygon(p,true,scale,g2);
}
}
if (controls.bShowAlignmentPattern) {
List<QrCode> codes=detector.getDetections();
g2.setColor(Color.BLUE);
g2.setStroke(new BasicStroke(3));
for (QrCode qr : codes) {
double size=Math.sqrt(qr.ppCorner.areaSimple()) / 14.0;
for (int i=0; i < qr.alignment.size; i++) {
QrCode.Alignment a=qr.alignment.get(i);
VisualizeFeatures.drawCircle(g2,a.pixel.x * scale,a.pixel.y * scale,size * scale);
}
}
}
if (controls.bShowPositionPattern) {
FastQueue<PositionPatternNode> nodes=detector.getDetectPositionPatterns().getPositionPatterns();
g2.setColor(Color.ORANGE);
g2.setStroke(new BasicStroke(3));
List<SquareEdge> list=new ArrayList<>();
for (int i=0; i < nodes.size(); i++) {
SquareNode n=nodes.get(i);
VisualizeShapes.drawPolygon(n.square,true,scale,g2);
for (int j=0; j < 4; j++) {
if (n.edges[j] != null) {
if (!list.contains(n.edges[j])) {
  list.add(n.edges[j]);
}
}
}
}
g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(new Color(255,150,100));
g2.setStroke(new BasicStroke(3));
Line2D.Double l=new Line2D.Double();
for (int i=0; i < list.size(); i++) {
SquareEdge e=list.get(i);
Point2D_F64 a=e.a.center;
Point2D_F64 b=e.b.center;
l.setLine(scale * a.x,scale * a.y,scale * b.x,scale * b.y);
g2.draw(l);
}
}
}
}