Program: 57856
Project: 57856
Buggy source:
protected void renderVerticalBand(GL2 gl,IDataGraphNode bottomNode,IDataGraphNode topNode,IEdgeRoutingStrategy edgeRoutingStrategy,ConnectionBandRenderer connectionBandRenderer,Color color){
  Point2D positionBottom=bottomNode.getPosition();
  Point2D positionTop=topNode.getPosition();
  float spacingY=(float)((positionTop.getY() - topNode.getHeight() / 2.0f) - (positionBottom.getY() + bottomNode.getHeight() / 2.0f));
  float deltaX=(float)(positionBottom.getX() - positionTop.getX());
  ArrayList<Point2D> edgePoints=new ArrayList<Point2D>();
  Pair<Point2D,Point2D> anchorPointsBottom=bottomNode.getTopAnchorPoints();
  Pair<Point2D,Point2D> anchorPointsTop=topNode.getBottomAnchorPoints();
  float ratioX=deltaX / viewFrustum.getWidth();
  float bottomEdgeAnchorX=(float)positionBottom.getX() - ratioX * bottomNode.getWidth() / 2.0f;
  float bottomEdgeAnchorY=(float)(anchorPointsBottom.getFirst().getY() + Math.min(0.2f * spacingY,pixelGLConverter.getGLHeightForPixelHeight(MAX_NODE_EDGE_ANCHOR_DISTANCE_PIXELS)));
  Point2D edgeAnchorPointBottom=new Point2D.Float(bottomEdgeAnchorX,bottomEdgeAnchorY);
  float topEdgeAnchorX=(float)positionTop.getX() + ratioX * topNode.getWidth() / 2.0f;
  float topEdgeAnchorY=(float)(anchorPointsTop.getFirst().getY() - Math.min(0.2f * spacingY,pixelGLConverter.getGLHeightForPixelHeight(MAX_NODE_EDGE_ANCHOR_DISTANCE_PIXELS)));
  Point2D edgeAnchorPointTop=new Point2D.Float(topEdgeAnchorX,topEdgeAnchorY);
  edgePoints.add(edgeAnchorPointBottom);
  edgePoints.add(edgeAnchorPointTop);
  edgeRoutingStrategy.createEdge(edgePoints);
  Point2D edgeRoutingHelperPointBottom=new Point2D.Float((float)edgeAnchorPointBottom.getX(),(float)anchorPointsBottom.getFirst().getY());
  Point2D edgeRoutingHelperPointTop=new Point2D.Float((float)edgeAnchorPointTop.getX(),(float)anchorPointsTop.getFirst().getY());
  edgePoints.add(edgeRoutingHelperPointTop);
  edgePoints.add(0,edgeRoutingHelperPointBottom);
  float nodeEdgeAnchorSpacingBottom=(float)edgeAnchorPointBottom.getY() - (float)anchorPointsBottom.getFirst().getY();
  Pair<Point2D,Point2D> offsetAnchorPointsBottom=new Pair<Point2D,Point2D>();
  offsetAnchorPointsBottom.setFirst(new Point2D.Float((float)anchorPointsBottom.getFirst().getX(),(float)anchorPointsBottom.getFirst().getY() + 0.3f * nodeEdgeAnchorSpacingBottom));
  offsetAnchorPointsBottom.setSecond(new Point2D.Float((float)anchorPointsBottom.getSecond().getX(),(float)anchorPointsBottom.getSecond().getY() + 0.3f * nodeEdgeAnchorSpacingBottom));
  float nodeEdgeAnchorSpacingTop=(float)Math.abs(edgeAnchorPointTop.getY() - (float)anchorPointsTop.getFirst().getY());
  Pair<Point2D,Point2D> offsetAnchorPointsTop=new Pair<Point2D,Point2D>();
  offsetAnchorPointsTop.setFirst(new Point2D.Float((float)anchorPointsTop.getFirst().getX(),(float)anchorPointsTop.getFirst().getY() - 0.3f * nodeEdgeAnchorSpacingTop));
  offsetAnchorPointsTop.setSecond(new Point2D.Float((float)anchorPointsTop.getSecond().getX(),(float)anchorPointsTop.getSecond().getY() - 0.3f * nodeEdgeAnchorSpacingTop));
  List<Vec3f> bandPoints=connectionBandRenderer.calcInterpolatedBand(gl,edgePoints,20,pixelGLConverter);
  renderBand(gl,connectionBandRenderer,bandPoints,color);
  Point2D bandAnchorPoint1Bottom=new Point2D.Float(bandPoints.get(0).x(),bandPoints.get(0).y());
  Point2D bandAnchorPoint2Bottom=new Point2D.Float(bandPoints.get(bandPoints.size() - 1).x(),bandPoints.get(bandPoints.size() - 1).y());
  Pair<Point2D,Point2D> bandAnchorPointsBottom=new Pair<Point2D,Point2D>(bandAnchorPoint2Bottom,bandAnchorPoint1Bottom);
  float vecXPoint1Bottom=(float)bandAnchorPoint1Bottom.getX() - bandPoints.get(1).x();
  float vecYPoint1Bottom=(float)bandAnchorPoint1Bottom.getY() - bandPoints.get(1).y();
  float vecXPoint2Bottom=(float)bandAnchorPoint2Bottom.getX() - bandPoints.get(bandPoints.size() - 2).x();
  float vecYPoint2Bottom=(float)bandAnchorPoint2Bottom.getY() - bandPoints.get(bandPoints.size() - 2).y();
  Point2D bandOffsetAnchorPoint1Bottom=calcPointOnLineWithFixedY(bandAnchorPoint1Bottom,vecXPoint1Bottom,vecYPoint1Bottom,(float)offsetAnchorPointsBottom.getFirst().getY(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getSecond().getX());
  Point2D bandOffsetAnchorPoint2Bottom=calcPointOnLineWithFixedY(bandAnchorPoint2Bottom,vecXPoint2Bottom,vecYPoint2Bottom,(float)offsetAnchorPointsBottom.getSecond().getY(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getFirst().getX());
  Pair<Point2D,Point2D> bandOffsetAnchorPointsBottom=new Pair<Point2D,Point2D>(bandOffsetAnchorPoint2Bottom,bandOffsetAnchorPoint1Bottom);
  Point2D bandAnchorPoint1Top=new Point2D.Float(bandPoints.get(bandPoints.size() / 2 - 1).x(),bandPoints.get(bandPoints.size() / 2 - 1).y());
  Point2D bandAnchorPoint2Top=new Point2D.Float(bandPoints.get(bandPoints.size() / 2).x(),bandPoints.get(bandPoints.size() / 2).y());
  Pair<Point2D,Point2D> bandAnchorPointsTop=new Pair<Point2D,Point2D>(bandAnchorPoint2Top,bandAnchorPoint1Top);
  float vecXPoint1Top=(float)bandAnchorPoint1Top.getX() - bandPoints.get(bandPoints.size() / 2 - 2).x();
  float vecYPoint1Top=(float)bandAnchorPoint1Top.getY() - bandPoints.get(bandPoints.size() / 2 - 2).y();
  float vecXPoint2Top=(float)bandAnchorPoint2Top.getX() - bandPoints.get(bandPoints.size() / 2 + 1).x();
  float vecYPoint2Top=(float)bandAnchorPoint2Top.getY() - bandPoints.get(bandPoints.size() / 2 + 1).y();
  Point2D bandOffsetAnchorPoint1Top=calcPointOnLineWithFixedY(bandAnchorPoint1Top,vecXPoint1Top,vecYPoint1Top,(float)offsetAnchorPointsTop.getFirst().getY(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getSecond().getX());
  Point2D bandOffsetAnchorPoint2Top=calcPointOnLineWithFixedY(bandAnchorPoint2Top,vecXPoint2Top,vecYPoint2Top,(float)offsetAnchorPointsTop.getSecond().getY(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getFirst().getX());
  Pair<Point2D,Point2D> bandOffsetAnchorPointsTop=new Pair<Point2D,Point2D>(bandOffsetAnchorPoint2Top,bandOffsetAnchorPoint1Top);
  List<Pair<Point2D,Point2D>> bottomBandConnectionPoints=new ArrayList<Pair<Point2D,Point2D>>();
  bottomBandConnectionPoints.add(anchorPointsBottom);
  bottomBandConnectionPoints.add(offsetAnchorPointsBottom);
  bottomBandConnectionPoints.add(bandOffsetAnchorPointsBottom);
  bottomBandConnectionPoints.add(bandAnchorPointsBottom);
  List<Pair<Point2D,Point2D>> topBandConnectionPoints=new ArrayList<Pair<Point2D,Point2D>>();
  topBandConnectionPoints.add(anchorPointsTop);
  topBandConnectionPoints.add(offsetAnchorPointsTop);
  topBandConnectionPoints.add(bandOffsetAnchorPointsTop);
  topBandConnectionPoints.add(bandAnchorPointsTop);
  connectionBandRenderer.renderComplexBand(gl,bottomBandConnectionPoints,false,color.getRGB(),0.5f);
  connectionBandRenderer.renderComplexBand(gl,topBandConnectionPoints,false,new float[]{(251f / 255f),(128f / 255f),(114f / 255f)},0.5f);
}

Fixed version (ground truth):
protected void renderVerticalBand(GL2 gl,IDataGraphNode bottomNode,IDataGraphNode topNode,IEdgeRoutingStrategy edgeRoutingStrategy,ConnectionBandRenderer connectionBandRenderer,Color color){
  Point2D positionBottom=bottomNode.getPosition();
  Point2D positionTop=topNode.getPosition();
  float spacingY=(float)((positionTop.getY() - topNode.getHeight() / 2.0f) - (positionBottom.getY() + bottomNode.getHeight() / 2.0f));
  float deltaX=(float)(positionBottom.getX() - positionTop.getX());
  ArrayList<Point2D> edgePoints=new ArrayList<Point2D>();
  Pair<Point2D,Point2D> anchorPointsBottom=bottomNode.getTopAnchorPoints();
  Pair<Point2D,Point2D> anchorPointsTop=topNode.getBottomAnchorPoints();
  float ratioX=deltaX / viewFrustum.getWidth();
  float bottomEdgeAnchorX=(float)positionBottom.getX() - ratioX * bottomNode.getWidth() / 2.0f;
  float bottomEdgeAnchorY=(float)(anchorPointsBottom.getFirst().getY() + Math.min(0.2f * spacingY,pixelGLConverter.getGLHeightForPixelHeight(MAX_NODE_EDGE_ANCHOR_DISTANCE_PIXELS)));
  Point2D edgeAnchorPointBottom=new Point2D.Float(bottomEdgeAnchorX,bottomEdgeAnchorY);
  float topEdgeAnchorX=(float)positionTop.getX() + ratioX * topNode.getWidth() / 2.0f;
  float topEdgeAnchorY=(float)(anchorPointsTop.getFirst().getY() - Math.min(0.2f * spacingY,pixelGLConverter.getGLHeightForPixelHeight(MAX_NODE_EDGE_ANCHOR_DISTANCE_PIXELS)));
  Point2D edgeAnchorPointTop=new Point2D.Float(topEdgeAnchorX,topEdgeAnchorY);
  edgePoints.add(edgeAnchorPointBottom);
  edgePoints.add(edgeAnchorPointTop);
  edgeRoutingStrategy.createEdge(edgePoints);
  Point2D edgeRoutingHelperPointBottom=new Point2D.Float((float)edgeAnchorPointBottom.getX(),(float)anchorPointsBottom.getFirst().getY());
  Point2D edgeRoutingHelperPointTop=new Point2D.Float((float)edgeAnchorPointTop.getX(),(float)anchorPointsTop.getFirst().getY());
  edgePoints.add(edgeRoutingHelperPointTop);
  edgePoints.add(0,edgeRoutingHelperPointBottom);
  float nodeEdgeAnchorSpacingBottom=(float)edgeAnchorPointBottom.getY() - (float)anchorPointsBottom.getFirst().getY();
  Pair<Point2D,Point2D> offsetAnchorPointsBottom=new Pair<Point2D,Point2D>();
  offsetAnchorPointsBottom.setFirst(new Point2D.Float((float)anchorPointsBottom.getFirst().getX(),(float)anchorPointsBottom.getFirst().getY() + 0.3f * nodeEdgeAnchorSpacingBottom));
  offsetAnchorPointsBottom.setSecond(new Point2D.Float((float)anchorPointsBottom.getSecond().getX(),(float)anchorPointsBottom.getSecond().getY() + 0.3f * nodeEdgeAnchorSpacingBottom));
  float nodeEdgeAnchorSpacingTop=(float)Math.abs(edgeAnchorPointTop.getY() - (float)anchorPointsTop.getFirst().getY());
  Pair<Point2D,Point2D> offsetAnchorPointsTop=new Pair<Point2D,Point2D>();
  offsetAnchorPointsTop.setFirst(new Point2D.Float((float)anchorPointsTop.getFirst().getX(),(float)anchorPointsTop.getFirst().getY() - 0.3f * nodeEdgeAnchorSpacingTop));
  offsetAnchorPointsTop.setSecond(new Point2D.Float((float)anchorPointsTop.getSecond().getX(),(float)anchorPointsTop.getSecond().getY() - 0.3f * nodeEdgeAnchorSpacingTop));
  List<Vec3f> bandPoints=connectionBandRenderer.calcInterpolatedBand(gl,edgePoints,20,pixelGLConverter);
  renderBand(gl,connectionBandRenderer,bandPoints,color);
  Point2D bandAnchorPoint1Bottom=new Point2D.Float(bandPoints.get(0).x(),bandPoints.get(0).y());
  Point2D bandAnchorPoint2Bottom=new Point2D.Float(bandPoints.get(bandPoints.size() - 1).x(),bandPoints.get(bandPoints.size() - 1).y());
  Pair<Point2D,Point2D> bandAnchorPointsBottom=new Pair<Point2D,Point2D>(bandAnchorPoint2Bottom,bandAnchorPoint1Bottom);
  float vecXPoint1Bottom=(float)bandAnchorPoint1Bottom.getX() - bandPoints.get(1).x();
  float vecYPoint1Bottom=(float)bandAnchorPoint1Bottom.getY() - bandPoints.get(1).y();
  float vecXPoint2Bottom=(float)bandAnchorPoint2Bottom.getX() - bandPoints.get(bandPoints.size() - 2).x();
  float vecYPoint2Bottom=(float)bandAnchorPoint2Bottom.getY() - bandPoints.get(bandPoints.size() - 2).y();
  Point2D bandOffsetAnchorPoint1Bottom=calcPointOnLineWithFixedY(bandAnchorPoint1Bottom,vecXPoint1Bottom,vecYPoint1Bottom,(float)offsetAnchorPointsBottom.getFirst().getY(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getSecond().getX());
  Point2D bandOffsetAnchorPoint2Bottom=calcPointOnLineWithFixedY(bandAnchorPoint2Bottom,vecXPoint2Bottom,vecYPoint2Bottom,(float)offsetAnchorPointsBottom.getSecond().getY(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getSecond().getX(),(float)offsetAnchorPointsBottom.getFirst().getX(),(float)offsetAnchorPointsBottom.getFirst().getX());
  Pair<Point2D,Point2D> bandOffsetAnchorPointsBottom=new Pair<Point2D,Point2D>(bandOffsetAnchorPoint2Bottom,bandOffsetAnchorPoint1Bottom);
  Point2D bandAnchorPoint1Top=new Point2D.Float(bandPoints.get(bandPoints.size() / 2 - 1).x(),bandPoints.get(bandPoints.size() / 2 - 1).y());
  Point2D bandAnchorPoint2Top=new Point2D.Float(bandPoints.get(bandPoints.size() / 2).x(),bandPoints.get(bandPoints.size() / 2).y());
  Pair<Point2D,Point2D> bandAnchorPointsTop=new Pair<Point2D,Point2D>(bandAnchorPoint2Top,bandAnchorPoint1Top);
  float vecXPoint1Top=(float)bandAnchorPoint1Top.getX() - bandPoints.get(bandPoints.size() / 2 - 2).x();
  float vecYPoint1Top=(float)bandAnchorPoint1Top.getY() - bandPoints.get(bandPoints.size() / 2 - 2).y();
  float vecXPoint2Top=(float)bandAnchorPoint2Top.getX() - bandPoints.get(bandPoints.size() / 2 + 1).x();
  float vecYPoint2Top=(float)bandAnchorPoint2Top.getY() - bandPoints.get(bandPoints.size() / 2 + 1).y();
  Point2D bandOffsetAnchorPoint1Top=calcPointOnLineWithFixedY(bandAnchorPoint1Top,vecXPoint1Top,vecYPoint1Top,(float)offsetAnchorPointsTop.getFirst().getY(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getSecond().getX());
  Point2D bandOffsetAnchorPoint2Top=calcPointOnLineWithFixedY(bandAnchorPoint2Top,vecXPoint2Top,vecYPoint2Top,(float)offsetAnchorPointsTop.getSecond().getY(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getSecond().getX(),(float)offsetAnchorPointsTop.getFirst().getX(),(float)offsetAnchorPointsTop.getFirst().getX());
  Pair<Point2D,Point2D> bandOffsetAnchorPointsTop=new Pair<Point2D,Point2D>(bandOffsetAnchorPoint2Top,bandOffsetAnchorPoint1Top);
  List<Pair<Point2D,Point2D>> bottomBandConnectionPoints=new ArrayList<Pair<Point2D,Point2D>>();
  bottomBandConnectionPoints.add(anchorPointsBottom);
  bottomBandConnectionPoints.add(offsetAnchorPointsBottom);
  bottomBandConnectionPoints.add(bandOffsetAnchorPointsBottom);
  bottomBandConnectionPoints.add(bandAnchorPointsBottom);
  List<Pair<Point2D,Point2D>> topBandConnectionPoints=new ArrayList<Pair<Point2D,Point2D>>();
  topBandConnectionPoints.add(anchorPointsTop);
  topBandConnectionPoints.add(offsetAnchorPointsTop);
  topBandConnectionPoints.add(bandOffsetAnchorPointsTop);
  topBandConnectionPoints.add(bandAnchorPointsTop);
  connectionBandRenderer.renderComplexBand(gl,bottomBandConnectionPoints,false,color.getRGB(),0.5f);
  connectionBandRenderer.renderComplexBand(gl,topBandConnectionPoints,false,color.getRGB(),0.5f);
}