Program: 70835
Project: 70835
Buggy source:
public void doDisplay(GLAutoDrawable drawable,int flags){
  GL2 gl=drawable.getGL().getGL2();
  if (resetViewVolume && resizeEnabled) {
    resetViewVolume();
    resetViewVolume=false;
  }
  if (isSelecting()) {
    invalidateProjectionMatrix();
  }
  gl.glPushMatrix();
  if (isSelecting()) {
    gl.glClearColor(0f,0f,0f,0f);
  }
 else {
    gl.glClearColor(backgroundColor[0],backgroundColor[1],backgroundColor[2],backgroundColor[3]);
  }
  gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
  GLSupport.transformToGLMatrix(GLMatrix,viewMatrix);
  gl.glLoadMatrixd(GLMatrix,0);
  viewMatrixValidP=true;
  setupLights(gl);
  if (!isSelecting()) {
    if (gridVisible) {
      myGrid.render(this,flags);
    }
    if (axisLength > 0) {
      drawAxes(gl,axisLength);
    }
    for (    Dragger3d dragger : myDraggers) {
      dragger.render(this,0);
    }
    if (myDrawTool != null) {
      myDrawTool.render(this,0);
    }
    for (    GLClipPlane cp : myClipPlanes) {
      cp.render(this,flags);
    }
  }
  maybeUpdateState(gl);
  int nclips=0;
  int clipIdx=GL2.GL_CLIP_PLANE0;
  for (  GLClipPlane cp : myClipPlanes) {
    if (cp.isClippingEnabled()) {
      cp.getPlaneValues(myClipPlaneValues);
      myClipPlaneValues[3]+=cp.getOffset();
      gl.glClipPlane(clipIdx,myClipPlaneValues,0);
      gl.glEnable(clipIdx);
      clipIdx++;
      nclips++;
      if (nclips >= maxClipPlanes) {
        break;
      }
      if (cp.isSlicingEnabled()) {
        myClipPlaneValues[0]=-myClipPlaneValues[0];
        myClipPlaneValues[1]=-myClipPlaneValues[1];
        myClipPlaneValues[2]=-myClipPlaneValues[2];
        myClipPlaneValues[3]=-myClipPlaneValues[3] + 2 * cp.getOffset();
        gl.glClipPlane(clipIdx,myClipPlaneValues,0);
        gl.glEnable(clipIdx);
        clipIdx++;
        nclips++;
        if (nclips >= maxClipPlanes) {
          break;
        }
      }
    }
  }
  gl.glPushMatrix();
  int qid=0;
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderOpaque(this,qid,flags);
    if (myExternalRenderList != null) {
      qid=myExternalRenderList.renderOpaque(this,qid,flags);
    }
  }
  if (!isSelecting()) {
    enableTransparency(gl);
  }
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderTransparent(this,qid,flags);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderTransparent(this,qid,flags);
    }
  }
  disableTransparency(gl);
  gl.glPopMatrix();
  for (int i=GL2.GL_CLIP_PLANE0; i < clipIdx; ++i) {
    gl.glDisable(i);
  }
  begin2DRendering(width,height);
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderOpaque2d(this,qid,0);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderOpaque2d(this,qid,0);
    }
  }
  enableTransparency(gl);
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderTransparent2d(this,qid,0);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderTransparent2d(this,qid,0);
    }
  }
  disableTransparency(gl);
  end2DRendering();
  gl.glPopMatrix();
  if (!isSelecting()) {
    if (myDragBox != null) {
      drawDragBox(gl);
    }
  }
  gl.glFlush();
}

Fixed version (ground truth):
public void doDisplay(GLAutoDrawable drawable,int flags){
  GL2 gl=drawable.getGL().getGL2();
  if (resetViewVolume && resizeEnabled) {
    resetViewVolume(gl);
    resetViewVolume=false;
  }
  if (isSelecting()) {
    invalidateProjectionMatrix();
  }
  gl.glPushMatrix();
  if (isSelecting()) {
    gl.glClearColor(0f,0f,0f,0f);
  }
 else {
    gl.glClearColor(backgroundColor[0],backgroundColor[1],backgroundColor[2],backgroundColor[3]);
  }
  gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
  GLSupport.transformToGLMatrix(GLMatrix,viewMatrix);
  gl.glLoadMatrixd(GLMatrix,0);
  viewMatrixValidP=true;
  setupLights(gl);
  if (!isSelecting()) {
    if (gridVisible) {
      myGrid.render(this,flags);
    }
    if (axisLength > 0) {
      drawAxes(gl,axisLength);
    }
    for (    Dragger3d dragger : myDraggers) {
      dragger.render(this,0);
    }
    if (myDrawTool != null) {
      myDrawTool.render(this,0);
    }
    for (    GLClipPlane cp : myClipPlanes) {
      cp.render(this,flags);
    }
  }
  maybeUpdateState(gl);
  int nclips=0;
  int clipIdx=GL2.GL_CLIP_PLANE0;
  for (  GLClipPlane cp : myClipPlanes) {
    if (cp.isClippingEnabled()) {
      cp.getPlaneValues(myClipPlaneValues);
      myClipPlaneValues[3]+=cp.getOffset();
      gl.glClipPlane(clipIdx,myClipPlaneValues,0);
      gl.glEnable(clipIdx);
      clipIdx++;
      nclips++;
      if (nclips >= maxClipPlanes) {
        break;
      }
      if (cp.isSlicingEnabled()) {
        myClipPlaneValues[0]=-myClipPlaneValues[0];
        myClipPlaneValues[1]=-myClipPlaneValues[1];
        myClipPlaneValues[2]=-myClipPlaneValues[2];
        myClipPlaneValues[3]=-myClipPlaneValues[3] + 2 * cp.getOffset();
        gl.glClipPlane(clipIdx,myClipPlaneValues,0);
        gl.glEnable(clipIdx);
        clipIdx++;
        nclips++;
        if (nclips >= maxClipPlanes) {
          break;
        }
      }
    }
  }
  gl.glPushMatrix();
  int qid=0;
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderOpaque(this,qid,flags);
    if (myExternalRenderList != null) {
      qid=myExternalRenderList.renderOpaque(this,qid,flags);
    }
  }
  if (!isSelecting()) {
    enableTransparency(gl);
  }
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderTransparent(this,qid,flags);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderTransparent(this,qid,flags);
    }
  }
  disableTransparency(gl);
  gl.glPopMatrix();
  for (int i=GL2.GL_CLIP_PLANE0; i < clipIdx; ++i) {
    gl.glDisable(i);
  }
  begin2DRendering(width,height);
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderOpaque2d(this,qid,0);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderOpaque2d(this,qid,0);
    }
  }
  enableTransparency(gl);
synchronized (myInternalRenderList) {
    qid=myInternalRenderList.renderTransparent2d(this,qid,0);
  }
  if (myExternalRenderList != null) {
synchronized (myExternalRenderList) {
      qid=myExternalRenderList.renderTransparent2d(this,qid,0);
    }
  }
  disableTransparency(gl);
  end2DRendering();
  gl.glPopMatrix();
  if (!isSelecting()) {
    if (myDragBox != null) {
      drawDragBox(gl);
    }
  }
  gl.glFlush();
}