Program: 70791
Project: 70791
Buggy source:
public void render(Renderer renderer,int flags){
  if (!(renderer instanceof GL2Viewer)) {
    return;
  }
  GL2Viewer viewer=(GL2Viewer)renderer;
  GL2 gl=viewer.getGL2();
  gl.glPushMatrix();
  RenderProps props=getRenderProps();
  boolean lastSelected=false;
  Shading savedShading=renderer.setPointShading(props);
  renderer.setPointColoring(props,isSelected());
switch (props.getPointStyle()) {
case POINT:
{
      renderer.setPointSize(props.getPointSize());
      if (renderer.isSelecting()) {
        int i=0;
        for (        VertexComponent vc : this) {
          if (vc.getRenderProps() == null) {
            renderer.beginSelectionQuery(i);
            gl.glBegin(GL2.GL_POINTS);
            gl.glVertex3fv(vc.getRenderCoords(),0);
            gl.glEnd();
            renderer.endSelectionQuery();
          }
          i++;
        }
      }
 else {
        VListPrint vPrint=getFingerPrint(PointStyle.POINT,0);
        BooleanHolder compile=new BooleanHolder(true);
        GL2VersionedObject gvo=viewer.getVersionedObject(gl,vKey,vPrint,compile);
        boolean useDisplayList=!renderer.isSelecting();
        if (compile.value || useDisplayList) {
          if (useDisplayList && compile.value) {
            gvo.beginCompile(gl);
          }
          gl.glBegin(GL2.GL_POINTS);
          for (          VertexComponent vc : this) {
            if (vc.getRenderProps() == null) {
              if (!isSelected()) {
                if (vc.isSelected() != lastSelected) {
                  renderer.setPointColoring(props,vc.isSelected());
                  lastSelected=vc.isSelected();
                }
              }
              gl.glVertex3fv(vc.getRenderCoords(),0);
            }
          }
          gl.glEnd();
          if (useDisplayList) {
            gvo.endCompile(gl);
            gvo.draw(gl);
          }
        }
 else {
          gvo.draw(gl);
        }
      }
      renderer.setPointSize(1);
      break;
    }
case SPHERE:
{
    BooleanHolder compile=new BooleanHolder(true);
    boolean useDisplayList=!renderer.isSelecting();
    GL2VersionedObject gvo=null;
    if (useDisplayList) {
      GL2Object sphere=viewer.getPrimitive(gl,PrimitiveType.SPHERE);
      VListPrint vPrint=getFingerPrint(PointStyle.POINT,sphere.hashCode());
      gvo=viewer.getVersionedObject(gl,vKey,vPrint,compile);
    }
    if (!useDisplayList || compile.value) {
      if (useDisplayList) {
        gvo.beginCompile(gl);
      }
      int i=0;
      for (      VertexComponent vc : this) {
        if (vc.getRenderProps() == null) {
          double rad=props.getPointRadius();
          if (renderer.isSelecting()) {
            renderer.beginSelectionQuery(i);
            renderer.drawSphere(vc.getRenderCoords(),rad);
            renderer.endSelectionQuery();
          }
 else {
            if (!isSelected()) {
              if (vc.isSelected() != lastSelected) {
                renderer.setPointColoring(props,vc.isSelected());
                lastSelected=vc.isSelected();
              }
            }
            renderer.drawSphere(vc.getRenderCoords(),rad);
          }
        }
        i++;
      }
      if (useDisplayList) {
        gvo.endCompile(gl);
        gvo.draw(gl);
      }
    }
 else {
      gvo.draw(gl);
      int err=gl.glGetError();
      if (err != GL.GL_NO_ERROR) {
        System.err.println("String_Node_Str" + err);
      }
    }
    break;
  }
}
renderer.setShading(savedShading);
gl.glPopMatrix();
}

Fixed version (ground truth):
public void render(Renderer renderer,int flags){
  if (!(renderer instanceof GL2Viewer)) {
    return;
  }
  GL2Viewer viewer=(GL2Viewer)renderer;
  GL2 gl=viewer.getGL2();
  gl.glPushMatrix();
  RenderProps props=getRenderProps();
  boolean lastSelected=false;
  Shading savedShading=renderer.setPointShading(props);
  renderer.setPointColoring(props,isSelected());
switch (props.getPointStyle()) {
case POINT:
{
      renderer.setPointSize(props.getPointSize());
      if (renderer.isSelecting()) {
        int i=0;
        for (        VertexComponent vc : this) {
          if (vc.getRenderProps() == null) {
            renderer.beginSelectionQuery(i);
            gl.glBegin(GL2.GL_POINTS);
            gl.glVertex3fv(vc.getRenderCoords(),0);
            gl.glEnd();
            renderer.endSelectionQuery();
          }
          i++;
        }
      }
 else {
        VListPrint vPrint=getFingerPrint(PointStyle.POINT,0);
        BooleanHolder compile=new BooleanHolder(true);
        GL2VersionedObject gvo=viewer.getVersionedObject(gl,vKey,vPrint,compile);
        boolean useDisplayList=!renderer.isSelecting();
        if (compile.value || useDisplayList) {
          if (useDisplayList && compile.value) {
            gvo.beginCompile(gl);
          }
          gl.glBegin(GL2.GL_POINTS);
          for (          VertexComponent vc : this) {
            if (vc.getRenderProps() == null) {
              if (!isSelected()) {
                if (vc.isSelected() != lastSelected) {
                  renderer.setPointColoring(props,vc.isSelected());
                  lastSelected=vc.isSelected();
                }
              }
              gl.glVertex3fv(vc.getRenderCoords(),0);
            }
          }
          gl.glEnd();
          if (useDisplayList) {
            gvo.endCompile(gl);
            gvo.draw(gl);
          }
        }
 else {
          gvo.draw(gl);
        }
      }
      renderer.setPointSize(1);
      break;
    }
case CUBE:
{
    BooleanHolder compile=new BooleanHolder(true);
    boolean useDisplayList=!renderer.isSelecting();
    GL2VersionedObject gvo=null;
    if (useDisplayList) {
      GL2Object sphere=viewer.getPrimitive(gl,PrimitiveType.SPHERE);
      VListPrint vPrint=getFingerPrint(PointStyle.POINT,sphere.hashCode());
      gvo=viewer.getVersionedObject(gl,vKey,vPrint,compile);
    }
    if (!useDisplayList || compile.value) {
      if (useDisplayList) {
        gvo.beginCompile(gl);
      }
      int i=0;
      double width=2 * props.getPointRadius();
      for (      VertexComponent vc : this) {
        if (vc.getRenderProps() == null) {
          if (renderer.isSelecting()) {
            renderer.beginSelectionQuery(i);
            renderer.drawCube(vc.getRenderCoords(),width);
            renderer.endSelectionQuery();
          }
 else {
            if (!isSelected()) {
              if (vc.isSelected() != lastSelected) {
                renderer.setPointColoring(props,vc.isSelected());
                lastSelected=vc.isSelected();
              }
            }
            renderer.drawCube(vc.getRenderCoords(),width);
          }
        }
        i++;
      }
      if (useDisplayList) {
        gvo.endCompile(gl);
        gvo.draw(gl);
      }
    }
 else {
      gvo.draw(gl);
      int err=gl.glGetError();
      if (err != GL.GL_NO_ERROR) {
        System.err.println("String_Node_Str" + err);
      }
    }
    break;
  }
case SPHERE:
{
  BooleanHolder compile=new BooleanHolder(true);
  boolean useDisplayList=!renderer.isSelecting();
  GL2VersionedObject gvo=null;
  if (useDisplayList) {
    GL2Object sphere=viewer.getPrimitive(gl,PrimitiveType.SPHERE);
    VListPrint vPrint=getFingerPrint(PointStyle.POINT,sphere.hashCode());
    gvo=viewer.getVersionedObject(gl,vKey,vPrint,compile);
  }
  if (!useDisplayList || compile.value) {
    if (useDisplayList) {
      gvo.beginCompile(gl);
    }
    int i=0;
    double rad=props.getPointRadius();
    for (    VertexComponent vc : this) {
      if (vc.getRenderProps() == null) {
        if (renderer.isSelecting()) {
          renderer.beginSelectionQuery(i);
          renderer.drawSphere(vc.getRenderCoords(),rad);
          renderer.endSelectionQuery();
        }
 else {
          if (!isSelected()) {
            if (vc.isSelected() != lastSelected) {
              renderer.setPointColoring(props,vc.isSelected());
              lastSelected=vc.isSelected();
            }
          }
          renderer.drawSphere(vc.getRenderCoords(),rad);
        }
      }
      i++;
    }
    if (useDisplayList) {
      gvo.endCompile(gl);
      gvo.draw(gl);
    }
  }
 else {
    gvo.draw(gl);
    int err=gl.glGetError();
    if (err != GL.GL_NO_ERROR) {
      System.err.println("String_Node_Str" + err);
    }
  }
  break;
}
}
renderer.setShading(savedShading);
gl.glPopMatrix();
}