Program: 150609
Project: 150609
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();
      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) {
renderAlignmentPatterns(g2,detector.getDetections());
renderAlignmentPatterns(g2,detector.getFailures());
}
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) {
synchronized (detected) {
        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);
        }
        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) {
synchronized (detected) {
renderAlignmentPatterns(g2,detected.toList());
renderAlignmentPatterns(g2,failures.toList());
}
}
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);
}
}
}
}