Program: 56706
Project: 56706
Buggy source:
protected void doRender(GLGraphics g,float w,float h,boolean pick){
  if (!enabled) {
    if (pick)     renderPickContent(g,w,h);
 else     content.render(g);
    return;
  }
  final boolean doHor=needHor();
  final boolean doVer=needVer();
  final GL2 gl=g.gl;
  if (doVer || doHor) {
    gl.glPushAttrib(GL2.GL_ENABLE_BIT);
  }
  if (doHor) {
    g.move(0,h - scrollBarWidth);
    g.pushName(horizontal.pickingId);
    if (pick)     horizontal.scrollBar.renderPick(g,doVer ? w - scrollBarWidth : w,scrollBarWidth,this);
 else     horizontal.scrollBar.render(g,doVer ? w - scrollBarWidth : w,scrollBarWidth,this);
    g.popName();
    g.move(0,-h + scrollBarWidth);
  }
  if (doVer) {
    g.move(w - scrollBarWidth,0);
    g.pushName(vertical.pickingId);
    if (pick)     vertical.scrollBar.renderPick(g,scrollBarWidth,doHor ? h - scrollBarWidth : h,this);
 else     vertical.scrollBar.render(g,scrollBarWidth,doHor ? h - scrollBarWidth : h,this);
    g.popName();
    g.move(-w + scrollBarWidth,0);
  }
  if (doHor) {
    double[] clipPlane1=new double[]{1.0,0.0,0.0,0};
    double[] clipPlane3=new double[]{-1.0,0.0,0.0,doVer ? w - scrollBarWidth : w};
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE0,clipPlane1,0);
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE1,clipPlane3,0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE1);
  }
  if (doVer) {
    double[] clipPlane2=new double[]{0.0,1.0,0.0,0};
    double[] clipPlane4=new double[]{0.0,-1.0,0.0,doHor ? h - scrollBarWidth : h};
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE2,clipPlane2,0);
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE3,clipPlane4,0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE2);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE3);
  }
  gl.glEnable(GL.GL_SCISSOR_TEST);
  IGLCanvas canvas=findCanvas();
  int height=canvas.toRawPixel(canvas.getDIPHeight());
  final Vec2f abs=getAbsoluteLocation();
  int locx=canvas.toRawPixel(abs.x());
  int locy=canvas.toRawPixel(abs.y());
  if (horizontal == null)   locx=0;
  if (vertical == null)   locy=0;
  int pixelW=canvas.toRawPixel(w);
  int pixelH=canvas.toRawPixel(h);
  gl.glScissor(locx,height - locy - pixelH + (doHor ? canvas.toRawPixel(scrollBarWidth) : 0),pixelW - (doVer ? canvas.toRawPixel(scrollBarWidth) : 0),pixelH - (doHor ? canvas.toRawPixel(scrollBarWidth) : 0));
  if (pick)   renderPickContent(g,w,h);
 else   content.render(g);
  gl.glDisable(GL.GL_SCISSOR_TEST);
  if (doVer || doHor) {
    gl.glPopAttrib();
  }
}

Fixed version (ground truth):
protected void doRender(GLGraphics g,float w,float h,boolean pick){
  if (!enabled) {
    if (pick)     renderPickContent(g,w,h);
 else     content.render(g);
    return;
  }
  final boolean doHor=needHor();
  final boolean doVer=needVer();
  final GL2 gl=g.gl;
  if (doVer || doHor) {
    gl.glPushAttrib(GL2.GL_ENABLE_BIT);
  }
  if (doHor) {
    g.move(0,h - scrollBarWidth);
    g.pushName(horizontal.pickingId);
    if (pick)     horizontal.scrollBar.renderPick(g,doVer ? w - scrollBarWidth : w,scrollBarWidth,this);
 else     horizontal.scrollBar.render(g,doVer ? w - scrollBarWidth : w,scrollBarWidth,this);
    g.popName();
    g.move(0,-h + scrollBarWidth);
  }
  if (doVer) {
    g.move(w - scrollBarWidth,0);
    g.pushName(vertical.pickingId);
    if (pick)     vertical.scrollBar.renderPick(g,scrollBarWidth,doHor ? h - scrollBarWidth : h,this);
 else     vertical.scrollBar.render(g,scrollBarWidth,doHor ? h - scrollBarWidth : h,this);
    g.popName();
    g.move(-w + scrollBarWidth,0);
  }
  if (doHor) {
    double[] clipPlane1=new double[]{1.0,0.0,0.0,0};
    double[] clipPlane3=new double[]{-1.0,0.0,0.0,doVer ? w - scrollBarWidth : w};
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE0,clipPlane1,0);
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE1,clipPlane3,0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE1);
  }
  if (doVer) {
    double[] clipPlane2=new double[]{0.0,1.0,0.0,0};
    double[] clipPlane4=new double[]{0.0,-1.0,0.0,doHor ? h - scrollBarWidth : h};
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE2,clipPlane2,0);
    gl.glClipPlane(GL2ES1.GL_CLIP_PLANE3,clipPlane4,0);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE2);
    gl.glEnable(GL2ES1.GL_CLIP_PLANE3);
  }
  gl.glEnable(GL.GL_SCISSOR_TEST);
  IGLCanvas canvas=findCanvas();
  int canvasW=canvas.toRawPixel(canvas.getDIPWidth());
  int canvasH=canvas.toRawPixel(canvas.getDIPHeight());
  final Vec2f abs=getAbsoluteLocation();
  int locx=canvas.toRawPixel(abs.x());
  int locy=canvas.toRawPixel(abs.y());
  int pixelW=canvas.toRawPixel(w);
  int pixelH=canvas.toRawPixel(h);
  if (horizontal == null) {
    locx=0;
    pixelW=canvasW;
  }
  if (vertical == null) {
    locy=0;
    pixelH=canvasH;
  }
  gl.glScissor(locx,canvasH - locy - pixelH + (doHor ? canvas.toRawPixel(scrollBarWidth) : 0),pixelW - (doVer ? canvas.toRawPixel(scrollBarWidth) : 0),pixelH - (doHor ? canvas.toRawPixel(scrollBarWidth) : 0));
  if (pick)   renderPickContent(g,w,h);
 else   content.render(g);
  gl.glDisable(GL.GL_SCISSOR_TEST);
  if (doVer || doHor) {
    gl.glPopAttrib();
  }
}