Program: 57094
Project: 57094
Buggy source:
private void renderGeneNode(GL2 gl,PathwayVertexRep vertexRep){
  float[] nodeColor;
  float width=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
  float height=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
  gl.glLineWidth(1);
  gl.glEnable(GL.GL_STENCIL_TEST);
  gl.glColorMask(false,false,false,false);
  gl.glDisable(GL.GL_DEPTH_TEST);
  gl.glDisable(GL.GL_BLEND);
  gl.glStencilFunc(GL.GL_GREATER,1,0xff);
  gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
  renderQuad(gl,width,height);
  gl.glDisable(GL.GL_STENCIL_TEST);
  gl.glColorMask(true,true,true,true);
  gl.glEnable(GL.GL_DEPTH_TEST);
  gl.glEnable(GL.GL_BLEND);
  if (mappingPerspective != null) {
    Average average=getExpressionAverage(mappingPerspective,vertexRep);
    if (average != null) {
      nodeColor=mappingPerspective.getDataDomain().getColorMapper().getColor((float)average.getArithmeticMean());
    }
 else {
      nodeColor=null;
    }
    if (average != null && nodeColor != null) {
      if (glPathwayView.getDetailLevel() == EDetailLevel.HIGH) {
        gl.glEnable(GL.GL_STENCIL_TEST);
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_BLEND);
        gl.glStencilFunc(GL.GL_GREATER,2,0xff);
        gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_KEEP);
        gl.glColor4f(nodeColor[0],nodeColor[1],nodeColor[2],0.8f);
        renderQuad(gl,width,height);
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_STENCIL_TEST);
        Float stdDev=pixelGLConverter.getGLWidthForPixelWidth(PathwayRenderStyle.ENZYME_NODE_PIXEL_WIDTH) * (float)average.getStandardDeviation() * 2.0f;
        if (!stdDev.isNaN()) {
          renderStdDevBar(gl,width,height,stdDev);
        }
        gl.glPushMatrix();
        gl.glTranslatef(0,-(2f * thirdOfstdDevBarHeight - onePxlHeight),0);
        if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
          nodeColor=SelectionType.SELECTION.getColor();
          gl.glColor4fv(nodeColor,0);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilFunc(GL.GL_GREATER,2,0xff);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
 else         if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
          nodeColor=SelectionType.MOUSE_OVER.getColor();
          gl.glColor4fv(nodeColor,0);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilFunc(GL.GL_GREATER,2,0xff);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
        gl.glPopMatrix();
      }
 else {
        gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
        gl.glEnable(GL.GL_STENCIL_TEST);
        gl.glColorMask(false,false,false,false);
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_BLEND);
        gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
        gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
        gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
        gl.glDisable(GL.GL_STENCIL_TEST);
        gl.glColorMask(true,true,true,true);
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glEnable(GL.GL_BLEND);
        if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
          nodeColor=SelectionType.SELECTION.getColor();
          gl.glColor4fv(nodeColor,0);
          gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
          gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
          gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
 else         if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
          nodeColor=SelectionType.MOUSE_OVER.getColor();
          gl.glColor4fv(nodeColor,0);
          gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
          gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
          gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
      }
    }
 else {
      gl.glColor4f(0,0,0,0);
      renderQuad(gl,width,height);
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
      gl.glColor4f(nodeColor[0],nodeColor[1],nodeColor[2],0.7f);
      float boxWidth=pixelGLConverter.getGLWidthForPixelWidth(PathwayRenderStyle.COMPOUND_NODE_PIXEL_WIDTH);
      float boxHeight=pixelGLConverter.getGLHeightForPixelHeight(PathwayRenderStyle.COMPOUND_NODE_PIXEL_HEIGHT);
      float y=height;
      gl.glDisable(GL.GL_DEPTH_TEST);
      gl.glBegin(GL2.GL_QUADS);
      gl.glNormal3f(0.0f,0.0f,1.0f);
      gl.glVertex3f(0,boxHeight,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(boxWidth,boxHeight,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(boxWidth,0,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(0,0,PathwayRenderStyle.Z_OFFSET);
      gl.glEnd();
      gl.glEnable(GL.GL_DEPTH_TEST);
      if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
        nodeColor=SelectionType.SELECTION.getColor();
        gl.glColor4fv(nodeColor,0);
        renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
        maskFramedEnzymeNode(gl,width,height);
      }
 else       if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
        nodeColor=SelectionType.MOUSE_OVER.getColor();
        gl.glColor4fv(nodeColor,0);
        renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
        maskFramedEnzymeNode(gl,width,height);
      }
    }
  }
 else {
    if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
      nodeColor=SelectionType.SELECTION.getColor();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
      nodeColor=SelectionType.MOUSE_OVER.getColor();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
    }
 else {
      nodeColor=new float[]{0,0,0,0};
    }
    gl.glColor4fv(nodeColor,0);
    renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
    gl.glCallList(framedEnzymeNodeDisplayListId);
    if (!vertexSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
      gl.glColor4f(0,0,0,0);
      renderQuad(gl,width,height);
    }
  }
}

Fixed version (ground truth):
private void renderGeneNode(GL2 gl,PathwayVertexRep vertexRep){
  float[] nodeColor;
  float width=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
  float height=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
  gl.glLineWidth(1);
  gl.glEnable(GL.GL_STENCIL_TEST);
  gl.glColorMask(false,false,false,false);
  gl.glDisable(GL.GL_DEPTH_TEST);
  gl.glDisable(GL.GL_BLEND);
  gl.glStencilFunc(GL.GL_GREATER,1,0xff);
  gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
  renderQuad(gl,width,height);
  gl.glDisable(GL.GL_STENCIL_TEST);
  gl.glColorMask(true,true,true,true);
  gl.glEnable(GL.GL_DEPTH_TEST);
  gl.glEnable(GL.GL_BLEND);
  if (mappingPerspective != null) {
    Average average=getExpressionAverage(mappingPerspective,vertexRep);
    if (average != null) {
      nodeColor=mappingPerspective.getDataDomain().getColorMapper().getColor((float)average.getArithmeticMean());
    }
 else {
      nodeColor=null;
    }
    if (average != null && nodeColor != null) {
      gl.glColor4f(nodeColor[0],nodeColor[1],nodeColor[2],0.8f);
      if (glPathwayView.getDetailLevel() == EDetailLevel.HIGH) {
        gl.glEnable(GL.GL_STENCIL_TEST);
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_BLEND);
        gl.glStencilFunc(GL.GL_GREATER,2,0xff);
        gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_KEEP);
        renderQuad(gl,width,height);
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_STENCIL_TEST);
        Float stdDev=pixelGLConverter.getGLWidthForPixelWidth(PathwayRenderStyle.ENZYME_NODE_PIXEL_WIDTH) * (float)average.getStandardDeviation() * 2.0f;
        if (!stdDev.isNaN()) {
          renderStdDevBar(gl,width,height,stdDev);
        }
        gl.glPushMatrix();
        gl.glTranslatef(0,-(2f * thirdOfstdDevBarHeight - onePxlHeight),0);
        if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
          nodeColor=SelectionType.SELECTION.getColor();
          gl.glColor4fv(nodeColor,0);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilFunc(GL.GL_GREATER,2,0xff);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
 else         if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
          nodeColor=SelectionType.MOUSE_OVER.getColor();
          gl.glColor4fv(nodeColor,0);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilFunc(GL.GL_GREATER,2,0xff);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_REPLACE,GL.GL_REPLACE);
          renderFrame(gl,width + onePxlWidth,height + (2f * thirdOfstdDevBarHeight) - onePxlHeight);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
        gl.glPopMatrix();
      }
 else {
        renderQuad(gl,width * 3,height * 3);
        gl.glEnable(GL.GL_STENCIL_TEST);
        gl.glColorMask(false,false,false,false);
        gl.glDisable(GL.GL_DEPTH_TEST);
        gl.glDisable(GL.GL_BLEND);
        gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
        gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
        renderQuad(gl,width * 3,height * 3);
        gl.glDisable(GL.GL_STENCIL_TEST);
        gl.glColorMask(true,true,true,true);
        gl.glEnable(GL.GL_DEPTH_TEST);
        gl.glEnable(GL.GL_BLEND);
        if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
          nodeColor=SelectionType.SELECTION.getColor();
          gl.glColor4fv(nodeColor,0);
          renderQuad(gl,width * 3,height * 3);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
          gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
          renderQuad(gl,width * 3,height * 3);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
 else         if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
          nodeColor=SelectionType.MOUSE_OVER.getColor();
          gl.glColor4fv(nodeColor,0);
          renderQuad(gl,width * 3,height * 3);
          gl.glEnable(GL.GL_STENCIL_TEST);
          gl.glColorMask(false,false,false,false);
          gl.glDisable(GL.GL_DEPTH_TEST);
          gl.glDisable(GL.GL_BLEND);
          gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
          gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
          renderQuad(gl,width * 3,height * 3);
          gl.glDisable(GL.GL_STENCIL_TEST);
          gl.glColorMask(true,true,true,true);
          gl.glEnable(GL.GL_DEPTH_TEST);
          gl.glEnable(GL.GL_BLEND);
        }
      }
    }
 else {
      gl.glColor4f(0,0,0,0);
      renderQuad(gl,width,height);
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
      gl.glColor4f(nodeColor[0],nodeColor[1],nodeColor[2],0.7f);
      float boxWidth=pixelGLConverter.getGLWidthForPixelWidth(PathwayRenderStyle.COMPOUND_NODE_PIXEL_WIDTH);
      float boxHeight=pixelGLConverter.getGLHeightForPixelHeight(PathwayRenderStyle.COMPOUND_NODE_PIXEL_HEIGHT);
      float y=height;
      gl.glDisable(GL.GL_DEPTH_TEST);
      gl.glBegin(GL2.GL_QUADS);
      gl.glNormal3f(0.0f,0.0f,1.0f);
      gl.glVertex3f(0,boxHeight,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(boxWidth,boxHeight,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(boxWidth,0,PathwayRenderStyle.Z_OFFSET);
      gl.glVertex3f(0,0,PathwayRenderStyle.Z_OFFSET);
      gl.glEnd();
      gl.glEnable(GL.GL_DEPTH_TEST);
      if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
        nodeColor=SelectionType.SELECTION.getColor();
        gl.glColor4fv(nodeColor,0);
        renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
        maskFramedEnzymeNode(gl,width,height);
      }
 else       if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
        nodeColor=SelectionType.MOUSE_OVER.getColor();
        gl.glColor4fv(nodeColor,0);
        renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
        maskFramedEnzymeNode(gl,width,height);
      }
    }
  }
 else {
    if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
      nodeColor=SelectionType.SELECTION.getColor();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
      nodeColor=SelectionType.MOUSE_OVER.getColor();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
    }
 else {
      nodeColor=new float[]{0,0,0,0};
    }
    gl.glColor4fv(nodeColor,0);
    renderFrame(gl,width + onePxlWidth,height + thirdOfstdDevBarHeight);
    gl.glCallList(framedEnzymeNodeDisplayListId);
    if (!vertexSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
      gl.glColor4f(0,0,0,0);
      renderQuad(gl,width,height);
    }
  }
}