Program: 56944
Project: 56944
Buggy source:
private void renderVertex(final GL2 gl,PathwayVertexRep vertexRep){
  Color tmpNodeColor=null;
  gl.glPushName(glPathwayView.getPickingManager().getPickingID(glPathwayView.getID(),EPickingType.PATHWAY_ELEMENT_SELECTION.name(),vertexRep.getID()));
  float canvasXPos=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getCenterX());
  float canvasYPos=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getCenterY());
  float vertexHeight=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
  canvasYPos+=vertexHeight;
  gl.glTranslatef(canvasXPos,-canvasYPos,0);
  EPathwayVertexType vertexType=vertexRep.getType();
switch (vertexType) {
case map:
    if (vertexRep.getName().contains("String_Node_Str")) {
      gl.glTranslatef(-canvasXPos,canvasYPos,0);
      gl.glPopName();
      return;
    }
  float nodeWidth=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
float nodeHeight=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
gl.glEnable(GL.GL_STENCIL_TEST);
gl.glColorMask(false,false,false,false);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
gl.glStencilOp(GL.GL_REPLACE,GL.GL_REPLACE,GL.GL_REPLACE);
renderQuad(gl,nodeWidth,nodeHeight);
gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
renderFrame(gl,nodeWidth,nodeHeight);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
tmpNodeColor=Color.TRANSPARENT;
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderQuad(gl,nodeWidth,nodeHeight);
if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderFrame(gl,nodeWidth,nodeHeight);
}
 else if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderFrame(gl,nodeWidth,nodeHeight);
}
break;
case compound:
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,1,0xff);
gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
gl.glCallList(compoundNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
EventBasedSelectionManager metabolicSelectionManager=glPathwayView.getMetaboliteSelectionManager();
if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(framedCompoundNodeDisplayListId);
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(framedCompoundNodeDisplayListId);
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()) || metabolicSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(framedCompoundNodeDisplayListId);
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(framedCompoundNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
}
tmpNodeColor=PathwayRenderStyle.COMPOUND_NODE_COLOR;
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(compoundNodeDisplayListId);
break;
case group:
break;
case gene:
case enzyme:
case other:
if (isVisible) renderGeneNode(gl,vertexRep);
 else {
float width=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
float height=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
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);
gl.glCallList(enzymeNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
Color nodeColor;
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=Color.BLACK;
}
gl.glColor4fv(nodeColor.getRGBA(),0);
gl.glCallList(framedEnzymeNodeDisplayListId);
if (!vertexSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
}
}
break;
default :
break;
}
gl.glTranslatef(-canvasXPos,canvasYPos,0);
gl.glPopName();
}

Fixed version (ground truth):
private void renderVertex(final GL2 gl,PathwayVertexRep vertexRep){
  Color tmpNodeColor=null;
  gl.glPushName(glPathwayView.getPickingManager().getPickingID(glPathwayView.getID(),EPickingType.PATHWAY_ELEMENT_SELECTION.name(),vertexRep.getID()));
  float canvasXPos=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getCenterX());
  float canvasYPos=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getCenterY());
  float vertexHeight=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
  canvasYPos+=vertexHeight;
  gl.glTranslatef(canvasXPos,-canvasYPos,0);
  EPathwayVertexType vertexType=vertexRep.getType();
switch (vertexType) {
case map:
    if (vertexRep.getName().contains("String_Node_Str")) {
      gl.glTranslatef(-canvasXPos,canvasYPos,0);
      gl.glPopName();
      return;
    }
  float nodeWidth=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
float nodeHeight=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
gl.glEnable(GL.GL_STENCIL_TEST);
gl.glColorMask(false,false,false,false);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
gl.glStencilOp(GL.GL_REPLACE,GL.GL_REPLACE,GL.GL_REPLACE);
renderQuad(gl,nodeWidth,nodeHeight);
gl.glStencilFunc(GL.GL_ALWAYS,2,0xff);
renderFrame(gl,nodeWidth,nodeHeight);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
tmpNodeColor=Color.TRANSPARENT;
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderQuad(gl,nodeWidth,nodeHeight);
if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderFrame(gl,nodeWidth,nodeHeight);
}
 else if (vertexSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
renderFrame(gl,nodeWidth,nodeHeight);
}
break;
case compound:
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,1,0xff);
gl.glStencilOp(GL.GL_KEEP,GL.GL_KEEP,GL.GL_REPLACE);
gl.glCallList(compoundNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
EventBasedSelectionManager metabolicSelectionManager=glPathwayView.getMetaboliteSelectionManager();
if (vertexSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(framedCompoundNodeDisplayListId);
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(framedCompoundNodeDisplayListId);
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()) || metabolicSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(framedCompoundNodeDisplayListId);
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(framedCompoundNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
}
tmpNodeColor=PathwayRenderStyle.COMPOUND_NODE_COLOR;
gl.glColor4fv(tmpNodeColor.getRGBA(),0);
gl.glCallList(compoundNodeDisplayListId);
break;
case group:
break;
case gene:
case enzyme:
case other:
if (isVisible) renderGeneNode(gl,vertexRep);
 else {
float width=pixelGLConverter.getGLWidthForPixelWidth(vertexRep.getWidth());
float height=pixelGLConverter.getGLHeightForPixelHeight(vertexRep.getHeight());
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);
gl.glCallList(enzymeNodeDisplayListId);
gl.glDisable(GL.GL_STENCIL_TEST);
gl.glColorMask(true,true,true,true);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
Color nodeColor;
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=Color.TRANSPARENT;
}
gl.glColor4fv(nodeColor.getRGBA(),0);
gl.glCallList(framedEnzymeNodeDisplayListId);
if (!vertexSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
}
}
break;
default :
break;
}
gl.glTranslatef(-canvasXPos,canvasYPos,0);
gl.glPopName();
}