Program: 70873
Project: 70873
Buggy source:
private void drawSpheres(RenderObject robj,double rad){
  GL2 gl=getGL2();
  maybeUpdateState(gl);
  List<int[]> pnts=robj.getPoints();
  int displayList=myGLResources.getSphereDisplayList(gl,myPointSlices);
  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.POINTS);
  PointFingerPrint fingerprint=new PointFingerPrint(robj.getVersionInfo(),PointStyle.SPHERE,displayList,(float)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);
    }
    for (    int[] pnt : pnts) {
      VertexIndexSet v=robj.getVertex(pnt[0]);
      if (!selecting && useColors) {
        setVertexColor(gl,robj.getColor(v.getColorIndex()),useHSV);
      }
      float[] p=robj.getPosition(v.getPositionIndex());
      gl.glPushMatrix();
      gl.glTranslatef(p[0],p[1],p[2]);
      gl.glScaled(rad,rad,rad);
      gl.glCallList(displayList);
      gl.glPopMatrix();
    }
    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 drawSpheres(RenderObject robj,double rad){
  GL2 gl=getGL2();
  maybeUpdateState(gl);
  List<int[]> pnts=robj.getPoints();
  int displayList=myGLResources.getSphereDisplayList(gl,myPointSlices);
  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.POINTS);
  PointFingerPrint fingerprint=new PointFingerPrint(robj.getVersionInfo(),PointStyle.SPHERE,displayList,(float)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);
    }
    for (    int[] pnt : pnts) {
      VertexIndexSet v=robj.getVertex(pnt[0]);
      if (!selecting && useColors) {
        setVertexColor(gl,robj.getColor(v.getColorIndex()),useHSV);
      }
      float[] p=robj.getPosition(v.getPositionIndex());
      gl.glPushMatrix();
      gl.glTranslatef(p[0],p[1],p[2]);
      gl.glScaled(rad,rad,rad);
      gl.glCallList(displayList);
      gl.glPopMatrix();
    }
    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);
    }
  }
}