Program: 57713
Project: 57713
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.glEnable(GL2.GL_BLEND);
gl.glBlendFunc(GL2.GL_SRC_ALPHA,GL2.GL_ONE_MINUS_SRC_ALPHA);
gl.glCallList(enzymeNodeDisplayListId);
gl.glEnable(GL2.GL_DEPTH_TEST);
gl.glColor3f(0,1,0);
float stdDev=PathwayRenderStyle.ENZYME_NODE_HEIGHT * (float)average.getStandardDeviation() * 5.0f;
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH,-PathwayRenderStyle.ENZYME_NODE_HEIGHT,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.02f,-PathwayRenderStyle.ENZYME_NODE_HEIGHT,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.02f,-PathwayRenderStyle.ENZYME_NODE_HEIGHT + stdDev,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH,-PathwayRenderStyle.ENZYME_NODE_HEIGHT + stdDev,Z_OFFSET);
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.glCallList(enzymeNodeDisplayListId);
gl.glColor3f(0,1,0);
Float stdDev=PathwayRenderStyle.ENZYME_NODE_HEIGHT * (float)average.getStandardDeviation() * 5.0f;
if (!stdDev.isNaN()) {
gl.glBegin(GL2.GL_QUADS);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH,-PathwayRenderStyle.ENZYME_NODE_HEIGHT,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.02f,-PathwayRenderStyle.ENZYME_NODE_HEIGHT,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH + 0.02f,-PathwayRenderStyle.ENZYME_NODE_HEIGHT + stdDev,Z_OFFSET);
gl.glVertex3f(PathwayRenderStyle.ENZYME_NODE_WIDTH,-PathwayRenderStyle.ENZYME_NODE_HEIGHT + stdDev,Z_OFFSET);
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();
}