Program: 58541
Project: 58541
Buggy source:
/** 
 * Renders the scene with polygonal connection lines (visual links)
 * @param gl The GL-object
 */
protected void callRenderPolygonLine(final GL gl){
  float width=0.0f;
  float color[]=new float[4];
  boolean roundedStart=false;
  boolean roundedEnd=false;
  if ((style == EVisLinkStyleType.SHADOW_VISLINK) || (style == EVisLinkStyleType.HALO_VISLINK)) {
    gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
    int hlAAQuality=1;
    boolean halo=false;
    if (style == EVisLinkStyleType.SHADOW_VISLINK) {
      width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH * ConnectionLineRenderStyle.CONNECTION_LINE_SHADOW_WIDTH_FACTOR;
      color=ConnectionLineRenderStyle.CONNECTION_LINE_SHADOW_COLOR;
    }
    if (style == EVisLinkStyleType.HALO_VISLINK) {
      width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH * ConnectionLineRenderStyle.CONNECTION_LINE_HALO_WIDTH_FACTOR;
      color[0]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[0];
      color[1]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[1];
      color[2]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[2];
      color[3]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[3] / 2.5f;
      hlAAQuality=5;
      halo=true;
    }
    for (int i=0; i < connectionLinesAllViews.size(); i++) {
      ArrayList<ArrayList<Vec3f>> currentStage=connectionLinesAllViews.get(i);
      if (style == EVisLinkStyleType.HALO_VISLINK)       if (i == 0)       roundedStart=true;
      if (i == (connectionLinesAllViews.size() - 1))       roundedEnd=true;
      for (      ArrayList<Vec3f> currentLine : currentStage) {
        if (currentLine.size() >= 2) {
          VisLink visLink=new VisLink(currentLine,0,SEGMENT_LENGTH);
          enableStencilBuffer(gl);
          if (i < 2)           visLink.drawPolygonLine(gl,width,color,hlAAQuality,roundedStart,roundedEnd,halo);
 else           visLink.drawPolygonLine(gl,width,color,hlAAQuality,roundedEnd,roundedStart,halo);
          disableStencilBuffer(gl);
        }
      }
      roundedStart=false;
      roundedEnd=false;
    }
  }
  gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
  width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH;
  color=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR;
  for (  ArrayList<ArrayList<Vec3f>> currentView : connectionLinesAllViews)   for (  ArrayList<Vec3f> currentLine : currentView) {
    if (currentLine.size() >= 2) {
      VisLink visLink=new VisLink(currentLine,0,SEGMENT_LENGTH);
      visLink.drawPolygonLine(gl,width,color,antiAliasingQuality,roundedStart,roundedEnd,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Renders the scene with polygonal connection lines (visual links)
 * @param gl The GL-object
 */
protected void callRenderPolygonLine(final GL gl){
  float width=0.0f;
  float color[]=new float[4];
  boolean roundedStart=false;
  boolean roundedEnd=false;
  if ((style == EVisLinkStyleType.SHADOW_VISLINK) || (style == EVisLinkStyleType.HALO_VISLINK)) {
    gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
    int hlAAQuality=1;
    boolean halo=false;
    if (style == EVisLinkStyleType.SHADOW_VISLINK) {
      width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH * ConnectionLineRenderStyle.CONNECTION_LINE_SHADOW_WIDTH_FACTOR;
      color=ConnectionLineRenderStyle.CONNECTION_LINE_SHADOW_COLOR;
    }
    if (style == EVisLinkStyleType.HALO_VISLINK) {
      width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH * ConnectionLineRenderStyle.CONNECTION_LINE_HALO_WIDTH_FACTOR;
      color[0]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[0];
      color[1]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[1];
      color[2]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[2];
      color[3]=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR[3] / 2.5f;
      hlAAQuality=5;
      halo=true;
    }
    for (int i=0; i < connectionLinesAllViews.size(); i++) {
      ArrayList<ArrayList<Vec3f>> currentStage=connectionLinesAllViews.get(i);
      if (style == EVisLinkStyleType.HALO_VISLINK && i == 0)       roundedStart=true;
      if (style == EVisLinkStyleType.HALO_VISLINK && i == (connectionLinesAllViews.size() - 1))       roundedEnd=true;
      for (      ArrayList<Vec3f> currentLine : currentStage) {
        if (currentLine.size() >= 2) {
          VisLink visLink=new VisLink(currentLine,0,SEGMENT_LENGTH);
          enableStencilBuffer(gl);
          if (i < 2)           visLink.drawPolygonLine(gl,width,color,hlAAQuality,roundedStart,roundedEnd,halo);
 else           visLink.drawPolygonLine(gl,width,color,hlAAQuality,roundedEnd,roundedStart,halo);
          disableStencilBuffer(gl);
        }
      }
      roundedStart=false;
      roundedEnd=false;
    }
  }
  gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
  width=ConnectionLineRenderStyle.CONNECTION_LINE_WIDTH;
  color=ConnectionLineRenderStyle.CONNECTION_LINE_COLOR;
  for (  ArrayList<ArrayList<Vec3f>> currentView : connectionLinesAllViews)   for (  ArrayList<Vec3f> currentLine : currentView) {
    if (currentLine.size() >= 2) {
      VisLink visLink=new VisLink(currentLine,0,SEGMENT_LENGTH);
      visLink.drawPolygonLine(gl,width,color,antiAliasingQuality,roundedStart,roundedEnd,false);
    }
  }
}