Program: 57710
Project: 57710
Buggy source:
private void createVertex(final GL2 gl,final IUniqueObject containingView,PathwayVertexRep vertexRep,PathwayGraph containingPathway){
  float[] tmpNodeColor=null;
  gl.glPushName(generalManager.getViewManager().getPickingManager().getPickingID(containingView.getID(),PickingType.PATHWAY_ELEMENT_SELECTION.name(),vertexRep.getID()));
  EPathwayVertexShape shape=vertexRep.getShapeType();
  if (shape.equals(EPathwayVertexShape.poly))   renderPolyVertex(gl,vertexRep);
  float canvasXPos=vertexRep.getCenterX() * PathwayRenderStyle.SCALING_FACTOR_X;
  float canvasYPos=vertexRep.getCenterY() * PathwayRenderStyle.SCALING_FACTOR_Y;
  float nodeWidth=vertexRep.getWidth() * PathwayRenderStyle.SCALING_FACTOR_X;
  float nodeHeight=vertexRep.getHeight() * PathwayRenderStyle.SCALING_FACTOR_Y;
  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;
    }
  tmpNodeColor=new float[]{0f,0f,0f,0.25f};
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayList(gl,nodeWidth,nodeHeight);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayListFrame(gl,nodeWidth,nodeHeight);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayListFrame(gl,nodeWidth,nodeHeight);
}
break;
case compound:
EventBasedSelectionManager metabolicSelectionManager=glPathwayView.getMetaboliteSelectionManager();
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedCompoundNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedCompoundNodeDisplayListId);
}
tmpNodeColor=PathwayRenderStyle.COMPOUND_NODE_COLOR;
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(compoundNodeDisplayListId);
break;
case group:
break;
case gene:
case enzyme:
case other:
gl.glLineWidth(1);
if (enableGeneMapping) {
Average average=getExpressionAverage(vertexRep);
if (average != null) tmpNodeColor=colorMapper.getColor((float)average.getArithmeticMean());
if (tmpNodeColor != null) {
if (glPathwayView.getDetailLevel() == EDetailLevel.HIGH) {
gl.glColor4f(tmpNodeColor[0],tmpNodeColor[1],tmpNodeColor[2],0.7f);
gl.glCallList(enzymeNodeDisplayListId);
Float stdDev=PathwayRenderStyle.ENZYME_NODE_HEIGHT * (float)average.getStandardDeviation() * 5.0f;
float x=PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.000f;
float y=-PathwayRenderStyle.ENZYME_NODE_HEIGHT + 0.002f;
if (!stdDev.isNaN()) {
gl.glColor4f(1,1,1,1f);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(x,y - .001f,Z_OFFSET);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y - .001f,Z_OFFSET);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,0 + .001f,Z_OFFSET);
gl.glVertex3f(x,0 + 0.001f,Z_OFFSET);
gl.glEnd();
gl.glColor4fv(PathwayRenderStyle.STD_DEV_COLOR,0);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(x,y,Z_OFFSET + 0.01f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y,Z_OFFSET + 0.01f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y + stdDev,Z_OFFSET + 0.01f);
gl.glVertex3f(x,y + stdDev,Z_OFFSET + 0.01f);
gl.glEnd();
gl.glColor4f(0,0,0,1f);
gl.glBegin(GL2.GL_LINE_LOOP);
gl.glVertex3f(x,y - .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y - .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,0 + .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x,0 + 0.001f,Z_OFFSET + 0.02f);
gl.glEnd();
}
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
}
 else {
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
}
}
}
 else {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
tmpNodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
gl.glColor4f(tmpNodeColor[0],tmpNodeColor[1],tmpNodeColor[2],0.7f);
gl.glCallList(compoundNodeDisplayListId);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
}
}
 else {
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
}
 else if (internalSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
tmpNodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
}
 else {
tmpNodeColor=new float[]{0,0,0,0};
}
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
if (!internalSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
}
}
break;
}
gl.glTranslatef(-canvasXPos,canvasYPos,0);
gl.glPopName();
}

Fixed version (ground truth):
private void createVertex(final GL2 gl,final IUniqueObject containingView,PathwayVertexRep vertexRep,PathwayGraph containingPathway){
  float[] tmpNodeColor=null;
  gl.glPushName(generalManager.getViewManager().getPickingManager().getPickingID(containingView.getID(),PickingType.PATHWAY_ELEMENT_SELECTION.name(),vertexRep.getID()));
  EPathwayVertexShape shape=vertexRep.getShapeType();
  if (shape.equals(EPathwayVertexShape.poly))   renderPolyVertex(gl,vertexRep);
  float canvasXPos=vertexRep.getCenterX() * PathwayRenderStyle.SCALING_FACTOR_X;
  float canvasYPos=vertexRep.getCenterY() * PathwayRenderStyle.SCALING_FACTOR_Y;
  float nodeWidth=vertexRep.getWidth() * PathwayRenderStyle.SCALING_FACTOR_X;
  float nodeHeight=vertexRep.getHeight() * PathwayRenderStyle.SCALING_FACTOR_Y;
  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;
    }
  tmpNodeColor=new float[]{0f,0f,0f,0.25f};
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayList(gl,nodeWidth,nodeHeight);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayListFrame(gl,nodeWidth,nodeHeight);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
fillNodeDisplayListFrame(gl,nodeWidth,nodeHeight);
}
break;
case compound:
EventBasedSelectionManager metabolicSelectionManager=glPathwayView.getMetaboliteSelectionManager();
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedCompoundNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID()) || metabolicSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getName().hashCode())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedCompoundNodeDisplayListId);
}
tmpNodeColor=PathwayRenderStyle.COMPOUND_NODE_COLOR;
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(compoundNodeDisplayListId);
break;
case group:
break;
case gene:
case enzyme:
case other:
gl.glLineWidth(1);
if (enableGeneMapping) {
Average average=getExpressionAverage(vertexRep);
if (average != null) tmpNodeColor=colorMapper.getColor((float)average.getArithmeticMean());
if (tmpNodeColor != null) {
if (glPathwayView.getDetailLevel() == EDetailLevel.HIGH) {
gl.glColor4f(tmpNodeColor[0],tmpNodeColor[1],tmpNodeColor[2],0.7f);
gl.glBlendFunc(GL2.GL_SRC_ALPHA,GL2.GL_ONE_MINUS_SRC_ALPHA);
gl.glCallList(enzymeNodeDisplayListId);
Float stdDev=PathwayRenderStyle.ENZYME_NODE_HEIGHT * (float)average.getStandardDeviation() * 5.0f;
float x=PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.000f;
float y=-PathwayRenderStyle.ENZYME_NODE_HEIGHT + 0.002f;
if (!stdDev.isNaN()) {
gl.glColor4f(1,1,1,1f);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(x,y - .001f,Z_OFFSET);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y - .001f,Z_OFFSET);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,0 + .001f,Z_OFFSET);
gl.glVertex3f(x,0 + 0.001f,Z_OFFSET);
gl.glEnd();
gl.glColor4fv(PathwayRenderStyle.STD_DEV_COLOR,0);
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(x,y,Z_OFFSET + 0.01f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y,Z_OFFSET + 0.01f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y + stdDev,Z_OFFSET + 0.01f);
gl.glVertex3f(x,y + stdDev,Z_OFFSET + 0.01f);
gl.glEnd();
gl.glColor4f(0,0,0,1f);
gl.glBegin(GL2.GL_LINE_LOOP);
gl.glVertex3f(x,y - .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,y - .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x + PathwayRenderStyle.STD_DEV_BAR_WIDTH,0 + .001f,Z_OFFSET + 0.02f);
gl.glVertex3f(x,0 + 0.001f,Z_OFFSET + 0.02f);
gl.glEnd();
}
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
}
 else {
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(upscaledFilledEnzymeNodeDisplayListId);
}
}
}
 else {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
tmpNodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
gl.glColor4f(tmpNodeColor[0],tmpNodeColor[1],tmpNodeColor[2],0.7f);
gl.glCallList(compoundNodeDisplayListId);
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
}
}
}
 else {
if (internalSelectionManager.checkStatus(SelectionType.SELECTION,vertexRep.getID())) {
tmpNodeColor=SelectionType.SELECTION.getColor();
}
 else if (internalSelectionManager.checkStatus(SelectionType.MOUSE_OVER,vertexRep.getID())) {
tmpNodeColor=SelectionType.MOUSE_OVER.getColor();
}
 else if (internalSelectionManager.checkStatus(SelectionType.NORMAL,vertexRep.getID())) {
tmpNodeColor=PathwayRenderStyle.ENZYME_NODE_COLOR;
}
 else {
tmpNodeColor=new float[]{0,0,0,0};
}
gl.glColor4fv(tmpNodeColor,0);
gl.glCallList(framedEnzymeNodeDisplayListId);
if (!internalSelectionManager.checkStatus(SelectionType.DESELECTED,vertexRep.getID())) {
gl.glColor4f(0,0,0,0);
gl.glCallList(enzymeNodeDisplayListId);
}
}
break;
}
gl.glTranslatef(-canvasXPos,canvasYPos,0);
gl.glPopName();
}