Program: 70795
Project: 70795
Buggy source:
@Override public void drawVertices(RenderObject robj,DrawMode mode){
  boolean enableLighting=false;
  if (isLightingEnabled() && !robj.hasNormals()) {
    enableLighting=true;
    setLightingEnabled(false);
  }
  maybeUpdateState(gl);
  boolean selecting=isSelecting();
  boolean hasColors=(robj.hasColors() && hasVertexColoring());
  boolean useColors=hasColors && !selecting;
  boolean useHSV=isHSVColorInterpolationEnabled() && !isLightingEnabled();
  if (useColors) {
    gl.glColorMaterial(GL2.GL_FRONT_AND_BACK,GL2.GL_AMBIENT_AND_DIFFUSE);
    if (!myHighlightColorActive) {
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
    }
    if (useHSV) {
      useHSV=setupHSVInterpolation(gl);
    }
  }
  boolean useDisplayList=!selecting || !hasColors;
  GL2VersionedObject gvo=null;
  RenderObjectKey key=new RenderObjectKey(robj.getIdentifier(),DrawType.VERTICES,0);
  VertexFingerPrint fingerprint=new VertexFingerPrint(robj.getVersionInfo(),mode);
  boolean compile=true;
  if (useDisplayList) {
    gvo=myGLResources.getVersionedObject(key);
    if (gvo != null) {
      boolean iv=gvo.disposeInvalid(gl);
      if (iv == true) {
        System.out.println("String_Node_Str" + gvo);
      }
    }
    if (gvo == null || gvo.disposeInvalid(gl)) {
      gvo=myGLResources.allocateVersionedObject(gl,key,fingerprint);
      compile=true;
    }
 else {
      compile=!(gvo.compareExchangeFingerPrint(fingerprint));
    }
  }
  if (compile) {
    if (gvo != null) {
      gvo.beginCompile(gl);
    }
switch (mode) {
case LINES:
      gl.glBegin(GL2.GL_LINES);
    break;
case LINE_LOOP:
  gl.glBegin(GL2.GL_LINE_LOOP);
break;
case LINE_STRIP:
gl.glBegin(GL2.GL_LINE_STRIP);
break;
case POINTS:
gl.glBegin(GL2.GL_POINTS);
break;
case TRIANGLES:
gl.glBegin(GL2.GL_TRIANGLES);
break;
case TRIANGLE_FAN:
gl.glBegin(GL2.GL_TRIANGLE_FAN);
break;
case TRIANGLE_STRIP:
gl.glBegin(GL2.GL_TRIANGLE_STRIP);
break;
default :
gl.glBegin(GL2.GL_POINTS);
break;
}
robj.readLock();
int vertexCount=robj.numVertices();
int positionOffset=robj.getVertexPositionOffset();
int normalOffset=robj.getVertexNormalOffset();
int colorOffset=robj.getVertexColorOffset();
int texcoordOffset=robj.getVertexTextureCoordOffset();
int vertexStride=robj.getVertexStride();
int[] verts=robj.getVertexBuffer();
int baseIdx=0;
for (int i=0; i < vertexCount; ++i) {
if (!selecting && useColors) {
setVertexColor(gl,robj.getColor(verts[baseIdx + colorOffset]),useHSV);
}
if (robj.hasNormals()) {
gl.glNormal3fv(robj.getNormal(verts[baseIdx + normalOffset]),0);
}
if (robj.hasTextureCoords()) {
gl.glTexCoord2fv(robj.getTextureCoord(verts[baseIdx + texcoordOffset]),0);
}
gl.glVertex3fv(robj.getPosition(verts[baseIdx + positionOffset]),0);
baseIdx+=vertexStride;
}
robj.readUnlock();
gl.glEnd();
if (gvo != null) {
gvo.endCompile(gl);
gvo.draw(gl);
}
}
 else {
gvo.draw(gl);
}
if (useColors) {
gl.glDisable(GL2.GL_COLOR_MATERIAL);
if (useHSV) {
gl.glUseProgramObjectARB(0);
}
}
if (enableLighting) {
setLightingEnabled(true);
}
}

Fixed version (ground truth):
@Override public void drawVertices(RenderObject robj,DrawMode mode){
  boolean enableLighting=false;
  if (isLightingEnabled() && !robj.hasNormals()) {
    enableLighting=true;
    setLightingEnabled(false);
  }
  maybeUpdateState(gl);
  boolean selecting=isSelecting();
  boolean hasColors=(robj.hasColors() && hasVertexColoring());
  boolean useColors=hasColors && !selecting;
  boolean useHSV=isHSVColorInterpolationEnabled();
  if (useColors) {
    gl.glColorMaterial(GL2.GL_FRONT_AND_BACK,GL2.GL_AMBIENT_AND_DIFFUSE);
    if (!myHighlightColorActive) {
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
    }
    if (useHSV) {
      useHSV=setupHSVInterpolation(gl);
    }
  }
  boolean useDisplayList=!selecting || !hasColors;
  GL2VersionedObject gvo=null;
  RenderObjectKey key=new RenderObjectKey(robj.getIdentifier(),DrawType.VERTICES,0);
  VertexFingerPrint fingerprint=new VertexFingerPrint(robj.getVersionInfo(),mode);
  boolean compile=true;
  if (useDisplayList) {
    gvo=myGLResources.getVersionedObject(key);
    if (gvo != null) {
      boolean iv=gvo.disposeInvalid(gl);
      if (iv == true) {
        System.out.println("String_Node_Str" + gvo);
      }
    }
    if (gvo == null || gvo.disposeInvalid(gl)) {
      gvo=myGLResources.allocateVersionedObject(gl,key,fingerprint);
      compile=true;
    }
 else {
      compile=!(gvo.compareExchangeFingerPrint(fingerprint));
    }
  }
  if (compile) {
    if (gvo != null) {
      gvo.beginCompile(gl);
    }
switch (mode) {
case LINES:
      gl.glBegin(GL2.GL_LINES);
    break;
case LINE_LOOP:
  gl.glBegin(GL2.GL_LINE_LOOP);
break;
case LINE_STRIP:
gl.glBegin(GL2.GL_LINE_STRIP);
break;
case POINTS:
gl.glBegin(GL2.GL_POINTS);
break;
case TRIANGLES:
gl.glBegin(GL2.GL_TRIANGLES);
break;
case TRIANGLE_FAN:
gl.glBegin(GL2.GL_TRIANGLE_FAN);
break;
case TRIANGLE_STRIP:
gl.glBegin(GL2.GL_TRIANGLE_STRIP);
break;
default :
gl.glBegin(GL2.GL_POINTS);
break;
}
robj.readLock();
int vertexCount=robj.numVertices();
int positionOffset=robj.getVertexPositionOffset();
int normalOffset=robj.getVertexNormalOffset();
int colorOffset=robj.getVertexColorOffset();
int texcoordOffset=robj.getVertexTextureCoordOffset();
int vertexStride=robj.getVertexStride();
int[] verts=robj.getVertexBuffer();
int baseIdx=0;
for (int i=0; i < vertexCount; ++i) {
if (!selecting && useColors) {
setVertexColor(gl,robj.getColor(verts[baseIdx + colorOffset]),useHSV);
}
if (robj.hasNormals()) {
gl.glNormal3fv(robj.getNormal(verts[baseIdx + normalOffset]),0);
}
if (robj.hasTextureCoords()) {
gl.glTexCoord2fv(robj.getTextureCoord(verts[baseIdx + texcoordOffset]),0);
}
gl.glVertex3fv(robj.getPosition(verts[baseIdx + positionOffset]),0);
baseIdx+=vertexStride;
}
robj.readUnlock();
gl.glEnd();
if (gvo != null) {
gvo.endCompile(gl);
gvo.draw(gl);
}
}
 else {
gvo.draw(gl);
}
if (useColors) {
gl.glDisable(GL2.GL_COLOR_MATERIAL);
if (useHSV) {
gl.glUseProgramObjectARB(0);
}
}
if (enableLighting) {
setLightingEnabled(true);
}
}