Program: 70878
Project: 70878
Buggy source:
private void drawSolidLines(RenderObject robj,LineStyle style,float rad){
  List<int[]> lines=robj.getLines();
  boolean selecting=isSelecting();
  boolean hasColors=(robj.hasColors() && isVertexColoringEnabled());
  boolean useColors=hasColors && !selecting;
  boolean useHSV=isHSVColorInterpolationEnabled() && !isLightingEnabled();
  if (useColors) {
    gl.glColorMaterial(GL2.GL_FRONT_AND_BACK,GL2.GL_AMBIENT_AND_DIFFUSE);
    gl.glEnable(GL2.GL_COLOR_MATERIAL);
    if (useHSV) {
      useHSV=setupHSVInterpolation(gl);
    }
  }
  boolean useDisplayList=!selecting || !hasColors;
  DisplayListPassport dlpp=null;
  RenderObjectKey key=new RenderObjectKey(robj,DrawType.LINES);
  LineFingerPrint fingerprint=new LineFingerPrint(robj.getVersionInfo(),style,myLineSlices,rad);
  boolean compile=true;
  if (useDisplayList) {
    dlpp=myGLResources.getDisplayListPassport(gl,key);
    if (dlpp == null) {
      dlpp=myGLResources.allocateDisplayListPassport(gl,key,fingerprint);
      compile=true;
    }
 else {
      compile=!(dlpp.compareExchangeFingerPrint(fingerprint));
    }
  }
  if (compile) {
    if (dlpp != null) {
      gl.glNewList(dlpp.getList(),GL2.GL_COMPILE);
    }
switch (style) {
case CYLINDER:
{
        if (!selecting && useColors) {
          for (          int[] line : lines) {
            VertexIndexSet v0=robj.getVertex(line[0]);
            VertexIndexSet v1=robj.getVertex(line[1]);
            float[] p0=robj.getPosition(v0.getPositionIndex());
            byte[] c0=robj.getColor(v0.getColorIndex());
            float[] p1=robj.getPosition(v1.getPositionIndex());
            byte[] c1=robj.getColor(v1.getColorIndex());
            drawColoredCylinder(gl,myLineSlices,rad,rad,p0,c0,p1,c1,true,useHSV);
          }
        }
 else {
          for (          int[] line : lines) {
            VertexIndexSet v0=robj.getVertex(line[0]);
            VertexIndexSet v1=robj.getVertex(line[1]);
            float[] p0=robj.getPosition(v0.getPositionIndex());
            float[] p1=robj.getPosition(v1.getPositionIndex());
            drawCylinder(gl,myLineSlices,rad,rad,p0,p1,true);
          }
        }
        break;
      }
case ELLIPSOID:
    if (!selecting && useColors) {
      for (      int[] line : lines) {
        VertexIndexSet v0=robj.getVertex(line[0]);
        VertexIndexSet v1=robj.getVertex(line[1]);
        float[] p0=robj.getPosition(v0.getPositionIndex());
        byte[] c0=robj.getColor(v0.getColorIndex());
        float[] p1=robj.getPosition(v1.getPositionIndex());
        byte[] c1=robj.getColor(v1.getColorIndex());
        drawColoredEllipsoid(gl,myLineSlices,rad,p0,c0,p1,c1,isHSVColorInterpolationEnabled());
      }
    }
 else {
      for (      int[] line : lines) {
        VertexIndexSet v0=robj.getVertex(line[0]);
        VertexIndexSet v1=robj.getVertex(line[1]);
        float[] p0=robj.getPosition(v0.getPositionIndex());
        float[] p1=robj.getPosition(v1.getPositionIndex());
        drawEllipsoid(gl,myLineSlices,rad,p0,p1);
      }
    }
  break;
case SOLID_ARROW:
{
  float arad=rad * 3;
  float aheight=arad * 2;
  if (!selecting && useColors) {
    for (    int[] line : lines) {
      VertexIndexSet v0=robj.getVertex(line[0]);
      VertexIndexSet v1=robj.getVertex(line[1]);
      float[] p0=robj.getPosition(v0.getPositionIndex());
      byte[] c0=robj.getColor(v0.getColorIndex());
      float[] p1=robj.getPosition(v1.getPositionIndex());
      byte[] c1=robj.getColor(v1.getColorIndex());
      drawColoredArrow(gl,myLineSlices,rad,arad,aheight,p0,c0,p1,c1,isHSVColorInterpolationEnabled(),true);
    }
  }
 else {
    for (    int[] line : lines) {
      VertexIndexSet v0=robj.getVertex(line[0]);
      VertexIndexSet v1=robj.getVertex(line[1]);
      float[] p0=robj.getPosition(v0.getPositionIndex());
      float[] p1=robj.getPosition(v1.getPositionIndex());
      drawArrow(gl,myLineSlices,rad,arad,aheight,p0,p1,true);
    }
  }
  break;
}
default :
}
if (dlpp != null) {
gl.glEndList();
gl.glCallList(dlpp.getList());
}
}
 else {
gl.glCallList(dlpp.getList());
}
if (useColors) {
gl.glDisable(GL2.GL_COLOR_MATERIAL);
if (useHSV) {
gl.glUseProgramObjectARB(0);
}
}
}

Fixed version (ground truth):
private void drawSolidLines(RenderObject robj,LineStyle style,float rad){
  List<int[]> lines=robj.getLines();
  boolean selecting=isSelecting();
  boolean hasColors=(robj.hasColors() && isVertexColoringEnabled());
  boolean useColors=hasColors && !selecting;
  boolean useHSV=isHSVColorInterpolationEnabled() && !isLightingEnabled();
  if (useColors) {
    gl.glColorMaterial(GL2.GL_FRONT_AND_BACK,GL2.GL_AMBIENT_AND_DIFFUSE);
    if (!mySelectedColorActive) {
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
    }
    if (useHSV) {
      useHSV=setupHSVInterpolation(gl);
    }
  }
  boolean useDisplayList=!selecting || !hasColors;
  DisplayListPassport dlpp=null;
  RenderObjectKey key=new RenderObjectKey(robj,DrawType.LINES);
  LineFingerPrint fingerprint=new LineFingerPrint(robj.getVersionInfo(),style,myLineSlices,rad);
  boolean compile=true;
  if (useDisplayList) {
    dlpp=myGLResources.getDisplayListPassport(gl,key);
    if (dlpp == null) {
      dlpp=myGLResources.allocateDisplayListPassport(gl,key,fingerprint);
      compile=true;
    }
 else {
      compile=!(dlpp.compareExchangeFingerPrint(fingerprint));
    }
  }
  if (compile) {
    if (dlpp != null) {
      gl.glNewList(dlpp.getList(),GL2.GL_COMPILE);
    }
switch (style) {
case CYLINDER:
{
        if (!selecting && useColors) {
          for (          int[] line : lines) {
            VertexIndexSet v0=robj.getVertex(line[0]);
            VertexIndexSet v1=robj.getVertex(line[1]);
            float[] p0=robj.getPosition(v0.getPositionIndex());
            byte[] c0=robj.getColor(v0.getColorIndex());
            float[] p1=robj.getPosition(v1.getPositionIndex());
            byte[] c1=robj.getColor(v1.getColorIndex());
            drawColoredCylinder(gl,myLineSlices,rad,rad,p0,c0,p1,c1,true,useHSV);
          }
        }
 else {
          for (          int[] line : lines) {
            VertexIndexSet v0=robj.getVertex(line[0]);
            VertexIndexSet v1=robj.getVertex(line[1]);
            float[] p0=robj.getPosition(v0.getPositionIndex());
            float[] p1=robj.getPosition(v1.getPositionIndex());
            drawCylinder(gl,myLineSlices,rad,rad,p0,p1,true);
          }
        }
        break;
      }
case ELLIPSOID:
    if (!selecting && useColors) {
      for (      int[] line : lines) {
        VertexIndexSet v0=robj.getVertex(line[0]);
        VertexIndexSet v1=robj.getVertex(line[1]);
        float[] p0=robj.getPosition(v0.getPositionIndex());
        byte[] c0=robj.getColor(v0.getColorIndex());
        float[] p1=robj.getPosition(v1.getPositionIndex());
        byte[] c1=robj.getColor(v1.getColorIndex());
        drawColoredEllipsoid(gl,myLineSlices,rad,p0,c0,p1,c1,isHSVColorInterpolationEnabled());
      }
    }
 else {
      for (      int[] line : lines) {
        VertexIndexSet v0=robj.getVertex(line[0]);
        VertexIndexSet v1=robj.getVertex(line[1]);
        float[] p0=robj.getPosition(v0.getPositionIndex());
        float[] p1=robj.getPosition(v1.getPositionIndex());
        drawEllipsoid(gl,myLineSlices,rad,p0,p1);
      }
    }
  break;
case SOLID_ARROW:
{
  float arad=rad * 3;
  float aheight=arad * 2;
  if (!selecting && useColors) {
    for (    int[] line : lines) {
      VertexIndexSet v0=robj.getVertex(line[0]);
      VertexIndexSet v1=robj.getVertex(line[1]);
      float[] p0=robj.getPosition(v0.getPositionIndex());
      byte[] c0=robj.getColor(v0.getColorIndex());
      float[] p1=robj.getPosition(v1.getPositionIndex());
      byte[] c1=robj.getColor(v1.getColorIndex());
      drawColoredArrow(gl,myLineSlices,rad,arad,aheight,p0,c0,p1,c1,isHSVColorInterpolationEnabled(),true);
    }
  }
 else {
    for (    int[] line : lines) {
      VertexIndexSet v0=robj.getVertex(line[0]);
      VertexIndexSet v1=robj.getVertex(line[1]);
      float[] p0=robj.getPosition(v0.getPositionIndex());
      float[] p1=robj.getPosition(v1.getPositionIndex());
      drawArrow(gl,myLineSlices,rad,arad,aheight,p0,p1,true);
    }
  }
  break;
}
default :
}
if (dlpp != null) {
gl.glEndList();
gl.glCallList(dlpp.getList());
}
}
 else {
gl.glCallList(dlpp.getList());
}
if (useColors) {
gl.glDisable(GL2.GL_COLOR_MATERIAL);
if (useHSV) {
gl.glUseProgramObjectARB(0);
}
}
}