Program: 70885
Project: 70885
Buggy source:
public void render(GLRenderer renderer,int flags){
  renderer.checkAndPrintGLError();
  GL2 gl=renderer.getGL2();
  gl.glPushMatrix();
  RenderProps props=getRenderProps();
  float[] color=props.getPointColorArray();
  float[] selColor=renderer.getSelectionColor().getColorComponents(new float[4]);
  Material pointMaterial=props.getPointMaterial();
  if (isSelected()) {
    color=selColor;
    pointMaterial=renderer.getSelectionMaterial();
  }
  if (useDisplayLists && displayList == 0) {
    displayList=DisplayListManager.allocList(gl);
    displayListValid=false;
  }
  boolean lastSelected=false;
switch (props.getPointStyle()) {
case POINT:
{
      renderer.setLightingEnabled(false);
      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 {
        renderer.setColor(color,false);
        if (useDisplayLists && !displayListValid) {
          gl.glNewList(displayList,GL2.GL_COMPILE_AND_EXECUTE);
        }
        if (!displayListValid || renderer.isSelecting()) {
          for (          VertexComponent vc : this) {
            if (vc.getRenderProps() == null) {
              if (vc.isSelected() && !lastSelected) {
                renderer.setColor(selColor);
                lastSelected=true;
              }
 else               if (!vc.isSelected() && lastSelected) {
                renderer.setColor(color);
              }
              gl.glBegin(GL2.GL_POINTS);
              gl.glVertex3fv(vc.getRenderCoords(),0);
              gl.glEnd();
            }
          }
          if (useDisplayLists) {
            gl.glEndList();
            displayListValid=true;
          }
        }
 else         if (displayListValid) {
          gl.glCallList(displayList);
        }
      }
      renderer.setPointSize(1);
      renderer.setLightingEnabled(true);
    }
case SPHERE:
{
    renderer.setMaterialAndShading(props,pointMaterial,false);
    if (useDisplayLists && !displayListValid) {
      renderer.validateInternalDisplayLists(props);
      gl.glNewList(displayList,GL2.GL_COMPILE_AND_EXECUTE);
    }
    if (!displayListValid || renderer.isSelecting()) {
      int i=0;
      for (      VertexComponent vc : this) {
        if (vc.getRenderProps() == null) {
          if (renderer.isSelecting()) {
            renderer.beginSelectionQuery(i);
            renderer.drawSphere(props,vc.getRenderCoords());
            renderer.endSelectionQuery();
          }
 else {
            if (vc.isSelected() && !lastSelected) {
              renderer.updateMaterial(props,renderer.getSelectionMaterial(),false);
              lastSelected=true;
            }
 else             if (!vc.isSelected() && lastSelected) {
              renderer.updateMaterial(props,pointMaterial,false);
              lastSelected=false;
            }
            renderer.drawSphere(props,vc.getRenderCoords());
          }
        }
        i++;
      }
      if (useDisplayLists) {
        gl.glEndList();
        displayListValid=true;
      }
    }
 else {
      gl.glCallList(displayList);
      int err=gl.glGetError();
      if (err != GL.GL_NO_ERROR) {
        System.err.println("String_Node_Str" + err);
      }
    }
    renderer.restoreShading(props);
  }
}
gl.glPopMatrix();
renderer.checkAndPrintGLError();
}

Fixed version (ground truth):
public void render(GLRenderer renderer,int flags){
  renderer.checkAndPrintGLError();
  GL2 gl=renderer.getGL2();
  gl.glPushMatrix();
  RenderProps props=getRenderProps();
  float[] color=props.getPointColorArray();
  float[] selColor=renderer.getSelectionColor().getColorComponents(new float[4]);
  Material pointMaterial=props.getPointMaterial();
  if (isSelected()) {
    color=selColor;
    pointMaterial=renderer.getSelectionMaterial();
  }
  if (useDisplayLists && displayList == 0) {
    displayList=DisplayListManager.allocList(gl);
    displayListValid=false;
  }
  boolean lastSelected=false;
switch (props.getPointStyle()) {
case POINT:
{
      renderer.setLightingEnabled(false);
      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 {
        renderer.setColor(color,false);
        if (useDisplayLists && !displayListValid) {
          gl.glNewList(displayList,GL2.GL_COMPILE_AND_EXECUTE);
        }
        if (!displayListValid || renderer.isSelecting()) {
          for (          VertexComponent vc : this) {
            if (vc.getRenderProps() == null) {
              if (vc.isSelected() && !lastSelected) {
                renderer.setColor(selColor);
                lastSelected=true;
              }
 else               if (!vc.isSelected() && lastSelected) {
                renderer.setColor(color);
              }
              gl.glBegin(GL2.GL_POINTS);
              gl.glVertex3fv(vc.getRenderCoords(),0);
              gl.glEnd();
            }
          }
          if (useDisplayLists) {
            gl.glEndList();
            displayListValid=true;
          }
        }
 else         if (displayListValid) {
          gl.glCallList(displayList);
        }
      }
      renderer.setPointSize(1);
      renderer.setLightingEnabled(true);
      break;
    }
case SPHERE:
{
    renderer.setMaterialAndShading(props,pointMaterial,false);
    if (useDisplayLists && !displayListValid) {
      renderer.validateInternalDisplayLists(props);
      gl.glNewList(displayList,GL2.GL_COMPILE_AND_EXECUTE);
    }
    if (!displayListValid || renderer.isSelecting()) {
      int i=0;
      for (      VertexComponent vc : this) {
        if (vc.getRenderProps() == null) {
          if (renderer.isSelecting()) {
            renderer.beginSelectionQuery(i);
            renderer.drawSphere(props,vc.getRenderCoords());
            renderer.endSelectionQuery();
          }
 else {
            if (vc.isSelected() && !lastSelected) {
              renderer.updateMaterial(props,renderer.getSelectionMaterial(),false);
              lastSelected=true;
            }
 else             if (!vc.isSelected() && lastSelected) {
              renderer.updateMaterial(props,pointMaterial,false);
              lastSelected=false;
            }
            renderer.drawSphere(props,vc.getRenderCoords());
          }
        }
        i++;
      }
      if (useDisplayLists) {
        gl.glEndList();
        displayListValid=true;
      }
    }
 else {
      gl.glCallList(displayList);
      int err=gl.glGetError();
      if (err != GL.GL_NO_ERROR) {
        System.err.println("String_Node_Str" + err);
      }
    }
    renderer.restoreShading(props);
    break;
  }
}
gl.glPopMatrix();
renderer.checkAndPrintGLError();
}