Program: 71020
Project: 71020
Buggy source:
protected void renderCylinders(GLRenderer renderer,RenderProps props,int flags){
  GL2 gl=renderer.getGL2().getGL2();
  int[] savedShadeModel=new int[1];
  gl.glGetIntegerv(GL2.GL_SHADE_MODEL,savedShadeModel,0);
  boolean reenableLighting=false;
  if (props.getLineColor() != null && !renderer.isSelecting()) {
    renderer.setMaterialAndShading(props,props.getLineMaterial(),(flags & GLRenderer.SELECTED) != 0);
  }
  boolean cull=gl.glIsEnabled(GL2.GL_CULL_FACE);
  if (cull) {
    gl.glDisable(GL2.GL_CULL_FACE);
  }
  boolean useDisplayList=false;
  int displayList=0;
  boolean useVertexColors=(flags & GLRenderer.VERTEX_COLORING) != 0;
  if (useDisplayListsIfPossible && isUsingDisplayList() && !(renderer.isSelecting() && useVertexColors)) {
    useDisplayList=true;
    displayList=props.getMeshDisplayList();
  }
  if (!useDisplayList || displayList < 1) {
    if (useDisplayList) {
      displayList=props.allocMeshDisplayList(gl);
      if (displayList > 0) {
        gl.glNewList(displayList,GL2.GL_COMPILE);
      }
    }
    if ((flags & MeshRenderer.IS_SELECTING) != 0) {
      useVertexColors=false;
    }
    boolean useHSVInterpolation=(flags & GLRenderer.HSV_COLOR_INTERPOLATION) != 0;
    useHSVInterpolation=false;
    if (useVertexColors && useHSVInterpolation) {
      useHSVInterpolation=setupHSVInterpolation(gl);
    }
    if (useVertexColors) {
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL2.GL_FRONT,GL2.GL_DIFFUSE);
      reenableLighting=renderer.isLightingEnabled();
      if (reenableLighting) {
        renderer.setLightingEnabled(false);
      }
      gl.glShadeModel(GL2.GL_SMOOTH);
    }
    boolean useRenderVtxs=isRenderBuffered() && !isFixed();
    float[] posa=new float[3];
    float[] posb=new float[3];
    float[] postmp=posb;
    int nslices=props.getLineSlices();
    double r=props.getLineRadius();
    for (int i=0; i < myLines.size(); i=i + 1 + renderSkip) {
      Polyline line=myLines.get(i);
      Vertex3d[] vtxs=line.getVertices();
      Point3d pnta=useRenderVtxs ? vtxs[0].myRenderPnt : vtxs[0].pnt;
      getFloatPoint(pnta,posa);
      for (int k=1; k < line.numVertices(); k++) {
        Point3d pntb=useRenderVtxs ? vtxs[k].myRenderPnt : vtxs[k].pnt;
        getFloatPoint(pntb,posb);
        if (useVertexColors) {
          drawColoredCylinder(gl,nslices,r,r,posa,vtxs[k - 1].getColorArray(),posb,vtxs[k].getColorArray(),false);
        }
 else {
          renderer.drawCylinder(props,posa,posb,true);
        }
        postmp=posa;
        posa=posb;
        posb=postmp;
      }
    }
    if (useVertexColors) {
      gl.glDisable(GL2.GL_COLOR_MATERIAL);
      if (reenableLighting) {
        renderer.setLightingEnabled(true);
      }
    }
    if (useVertexColors && useHSVInterpolation) {
      gl.glUseProgramObjectARB(0);
    }
    if (useDisplayList && displayList > 0) {
      gl.glEndList();
      gl.glCallList(displayList);
    }
  }
 else {
    gl.glCallList(displayList);
  }
  if (cull) {
    gl.glEnable(GL2.GL_CULL_FACE);
  }
  renderer.restoreShading(props);
  gl.glShadeModel(savedShadeModel[0]);
}

Fixed version (ground truth):
protected void renderCylinders(GLRenderer renderer,RenderProps props,int flags){
  GL2 gl=renderer.getGL2().getGL2();
  int[] savedShadeModel=new int[1];
  gl.glGetIntegerv(GL2.GL_SHADE_MODEL,savedShadeModel,0);
  boolean reenableLighting=false;
  if (props.getLineColor() != null && !renderer.isSelecting()) {
    renderer.setMaterialAndShading(props,props.getLineMaterial(),(flags & GLRenderer.SELECTED) != 0);
  }
  boolean cull=gl.glIsEnabled(GL2.GL_CULL_FACE);
  if (cull) {
    gl.glDisable(GL2.GL_CULL_FACE);
  }
  boolean useDisplayList=false;
  int displayList=0;
  boolean useVertexColors=(flags & GLRenderer.VERTEX_COLORING) != 0;
  if (useDisplayListsIfPossible && isUsingDisplayList() && !(renderer.isSelecting() && useVertexColors)) {
    useDisplayList=true;
    displayList=props.getMeshDisplayList();
  }
  if (!useDisplayList || displayList < 1) {
    if (useDisplayList) {
      displayList=props.allocMeshDisplayList(gl);
      if (displayList > 0) {
        renderer.validateInternalDisplayLists(props);
        gl.glNewList(displayList,GL2.GL_COMPILE);
      }
    }
    if ((flags & MeshRenderer.IS_SELECTING) != 0) {
      useVertexColors=false;
    }
    boolean useHSVInterpolation=(flags & GLRenderer.HSV_COLOR_INTERPOLATION) != 0;
    useHSVInterpolation=false;
    if (useVertexColors && useHSVInterpolation) {
      useHSVInterpolation=setupHSVInterpolation(gl);
    }
    if (useVertexColors) {
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL2.GL_FRONT,GL2.GL_DIFFUSE);
      reenableLighting=renderer.isLightingEnabled();
      if (reenableLighting) {
        renderer.setLightingEnabled(false);
      }
      gl.glShadeModel(GL2.GL_SMOOTH);
    }
    boolean useRenderVtxs=isRenderBuffered() && !isFixed();
    float[] posa=new float[3];
    float[] posb=new float[3];
    float[] postmp=posb;
    int nslices=props.getLineSlices();
    double r=props.getLineRadius();
    for (int i=0; i < myLines.size(); i=i + 1 + renderSkip) {
      Polyline line=myLines.get(i);
      Vertex3d[] vtxs=line.getVertices();
      Point3d pnta=useRenderVtxs ? vtxs[0].myRenderPnt : vtxs[0].pnt;
      getFloatPoint(pnta,posa);
      for (int k=1; k < line.numVertices(); k++) {
        Point3d pntb=useRenderVtxs ? vtxs[k].myRenderPnt : vtxs[k].pnt;
        getFloatPoint(pntb,posb);
        if (useVertexColors) {
          drawColoredCylinder(gl,nslices,r,r,posa,vtxs[k - 1].getColorArray(),posb,vtxs[k].getColorArray(),false);
        }
 else {
          renderer.drawCylinder(props,posa,posb,true);
        }
        postmp=posa;
        posa=posb;
        posb=postmp;
      }
    }
    if (useVertexColors) {
      gl.glDisable(GL2.GL_COLOR_MATERIAL);
      if (reenableLighting) {
        renderer.setLightingEnabled(true);
      }
    }
    if (useVertexColors && useHSVInterpolation) {
      gl.glUseProgramObjectARB(0);
    }
    if (useDisplayList && displayList > 0) {
      gl.glEndList();
      gl.glCallList(displayList);
    }
  }
 else {
    gl.glCallList(displayList);
  }
  if (cull) {
    gl.glEnable(GL2.GL_CULL_FACE);
  }
  renderer.restoreShading(props);
  gl.glShadeModel(savedShadeModel[0]);
}