Program: 56890
Project: 56890
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().getTable().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().getRGBA();
          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().getRGBA();
          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().getRGBA();
          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().getRGBA();
          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.getRGBA();
      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().getRGBA();
        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().getRGBA();
        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().getRGBA();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
      nodeColor=SelectionType.MOUSE_OVER.getColor().getRGBA();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR.getRGBA();
    }
 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().getTable().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().getRGBA();
          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().getRGBA();
          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().getRGBA();
          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().getRGBA();
          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(1,1,1,1);
      renderQuad(gl,width,height);
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR.getRGBA();
      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().getRGBA();
        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().getRGBA();
        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().getRGBA();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
      nodeColor=SelectionType.MOUSE_OVER.getColor().getRGBA();
      maskFramedEnzymeNode(gl,width,height);
    }
 else     if (vertexSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
      nodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR.getRGBA();
    }
 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);
    }
  }
  Pair<TablePerspective,Average> highestAverage=null;
  Average average;
  for (  TablePerspective tablePerspective : glPathwayView.getTablePerspectives()) {
    average=getExpressionAverage(tablePerspective,vertexRep);
    if (average == null)     continue;
    if (average.getStandardDeviation() > 0.1) {
      if (highestAverage == null || average.getStandardDeviation() > highestAverage.getSecond().getStandardDeviation()) {
        highestAverage=new Pair<>(tablePerspective,average);
      }
    }
  }
  if (highestAverage != null) {
    gl.glColor3fv(highestAverage.getFirst().getDataDomain().getColor().getRGB(),0);
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(width,height,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width - 5 * onePxlWidth,height,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width - 4 * onePxlWidth,height - 10,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width - 1 * onePxlWidth,height - 10,PathwayRenderStyle.Z_OFFSET);
    gl.glEnd();
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(width,0 + 5,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width - 5 * onePxlWidth,0 + 5,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width - 5 * onePxlWidth,0,PathwayRenderStyle.Z_OFFSET);
    gl.glVertex3f(width,0,PathwayRenderStyle.Z_OFFSET);
    gl.glEnd();
  }
}