Program: 59204
Project: 59204
Buggy source:
public void renderPart(GL gl){
  this.gl=gl;
  int iDisplayListNodeId=0;
  int iDisplayListEdgeId=0;
  for (int iDisplayListIndex=0; iDisplayListIndex < iArPathwayNodeDisplayListIDs.size(); iDisplayListIndex++) {
    iDisplayListNodeId=iArPathwayNodeDisplayListIDs.get(iDisplayListIndex);
    iDisplayListEdgeId=iArPathwayEdgeDisplayListIDs.get(iDisplayListIndex);
    if (bShowPathwayTexture == false) {
      gl.glCallList(iDisplayListEdgeId);
    }
    gl.glCallList(iDisplayListNodeId);
  }
  if (bShowPathwayTexture == true) {
    Iterator<Pathway> iterPathways=refGeneralManager.getSingelton().getPathwayManager().getPathwayIterator();
    Texture refPathwayTexture=null;
    Pathway refTmpPathway=null;
    float fTmpZLayerValue=0.0f;
    while (iterPathways.hasNext()) {
      refTmpPathway=iterPathways.next();
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fTmpZLayerValue=refHashPathwayToZLayerValue.get(refTmpPathway);
      gl.glEnable(GL.GL_TEXTURE_2D);
      refPathwayTexture.bind();
      gl.glTexEnvf(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_ENV_MODE,GL.GL_REPLACE);
      gl.glColor3f(0.9f,0.9f,0.9f);
      TextureCoords texCoords=refPathwayTexture.getImageTexCoords();
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
      fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
      fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
      gl.glBegin(GL.GL_QUADS);
      gl.glTexCoord2f(0,texCoords.top());
      gl.glVertex3f(0.0f,0.0f,fTmpZLayerValue);
      gl.glTexCoord2f(texCoords.right(),texCoords.top());
      gl.glVertex3f(fPathwayTextureAspectRatio,0.0f,fTmpZLayerValue);
      gl.glTexCoord2f(texCoords.right(),0);
      gl.glVertex3f(fPathwayTextureAspectRatio,1f,fTmpZLayerValue);
      gl.glTexCoord2f(0,0);
      gl.glVertex3f(0.0f,1f,fTmpZLayerValue);
      gl.glEnd();
      gl.glDisable(GL.GL_TEXTURE_2D);
    }
  }
  Color nodeColor=refRenderStyle.getHighlightedNodeColor();
  if (!iArSelectionStorageVertexIDs.isEmpty()) {
    Pathway refTmpPathway=null;
    PathwayVertex refCurrentVertex=null;
    PathwayVertex refTmpVertex=null;
    IPathwayVertexRep refCurrentVertexRep=null;
    Texture refPathwayTexture=null;
    Iterator<PathwayVertex> iterSelectedVertices=iArSelectionStorageVertexIDs.iterator();
    Iterator<Integer> iterSelectedNeighborDistance=iArSelectionStorageNeighborDistance.iterator();
    Iterator<PathwayVertex> iterIdenticalVertices=null;
    Iterator<Pathway> iterDrawnPathways=null;
    while (iterSelectedVertices.hasNext()) {
      fZLayerValue=0.0f;
      refCurrentVertex=iterSelectedVertices.next();
      createVertex(refCurrentVertex.getVertexRepByIndex(iVertexRepIndex),true,nodeColor);
      iterDrawnPathways=refHashPathwayToZLayerValue.keySet().iterator();
      while (iterDrawnPathways.hasNext()) {
        refTmpPathway=iterDrawnPathways.next();
        iterIdenticalVertices=refGeneralManager.getSingelton().getPathwayElementManager().getPathwayVertexListByName(refCurrentVertex.getElementTitle()).iterator();
        while (iterIdenticalVertices.hasNext()) {
          refTmpVertex=iterIdenticalVertices.next();
          if (refTmpPathway.isVertexInPathway(refTmpVertex) == true) {
            fZLayerValue=refHashPathwayToZLayerValue.get(refTmpPathway);
            refCurrentVertexRep=refTmpVertex.getVertexRepByIndex(iVertexRepIndex);
            if (refCurrentVertexRep != null) {
              refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
              fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
              fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
              fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
              createVertex(refCurrentVertexRep,true,nodeColor);
              if (!refTmpPathway.equals(refBasicPathway)) {
                connectVertices(refCurrentVertexRep,refCurrentVertex.getVertexRepByIndex(iVertexRepIndex));
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void renderPart(GL gl){
  this.gl=gl;
  int iDisplayListNodeId=0;
  int iDisplayListEdgeId=0;
  for (int iDisplayListIndex=0; iDisplayListIndex < iArPathwayNodeDisplayListIDs.size(); iDisplayListIndex++) {
    iDisplayListNodeId=iArPathwayNodeDisplayListIDs.get(iDisplayListIndex);
    iDisplayListEdgeId=iArPathwayEdgeDisplayListIDs.get(iDisplayListIndex);
    if (bShowPathwayTexture == false) {
      gl.glCallList(iDisplayListEdgeId);
    }
    gl.glCallList(iDisplayListNodeId);
  }
  if (bShowPathwayTexture == true) {
    Iterator<Pathway> iterPathways=refHashPathwayToZLayerValue.keySet().iterator();
    Texture refPathwayTexture=null;
    Pathway refTmpPathway=null;
    float fTmpZLayerValue=0.0f;
    while (iterPathways.hasNext()) {
      refTmpPathway=iterPathways.next();
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fTmpZLayerValue=refHashPathwayToZLayerValue.get(refTmpPathway);
      gl.glEnable(GL.GL_TEXTURE_2D);
      refPathwayTexture.bind();
      gl.glTexEnvf(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_ENV_MODE,GL.GL_REPLACE);
      gl.glColor3f(0.9f,0.9f,0.9f);
      TextureCoords texCoords=refPathwayTexture.getImageTexCoords();
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
      fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
      fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
      gl.glBegin(GL.GL_QUADS);
      gl.glTexCoord2f(0,texCoords.top());
      gl.glVertex3f(0.0f,0.0f,fTmpZLayerValue);
      gl.glTexCoord2f(texCoords.right(),texCoords.top());
      gl.glVertex3f(fPathwayTextureAspectRatio,0.0f,fTmpZLayerValue);
      gl.glTexCoord2f(texCoords.right(),0);
      gl.glVertex3f(fPathwayTextureAspectRatio,1f,fTmpZLayerValue);
      gl.glTexCoord2f(0,0);
      gl.glVertex3f(0.0f,1f,fTmpZLayerValue);
      gl.glEnd();
      gl.glDisable(GL.GL_TEXTURE_2D);
    }
  }
 else {
    Iterator<Pathway> iterPathways=refHashPathwayToZLayerValue.keySet().iterator();
    Texture refPathwayTexture=null;
    Pathway refTmpPathway=null;
    float fTmpZLayerValue=0.0f;
    while (iterPathways.hasNext()) {
      refTmpPathway=iterPathways.next();
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fTmpZLayerValue=refHashPathwayToZLayerValue.get(refTmpPathway);
      gl.glColor3f(0.9f,0.9f,0.9f);
      refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
      fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
      fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
      fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
      gl.glBegin(GL.GL_QUADS);
      gl.glVertex3f(0.0f,0.0f,fTmpZLayerValue);
      gl.glVertex3f(fPathwayTextureAspectRatio,0.0f,fTmpZLayerValue);
      gl.glVertex3f(fPathwayTextureAspectRatio,1f,fTmpZLayerValue);
      gl.glVertex3f(0.0f,1f,fTmpZLayerValue);
      gl.glEnd();
    }
  }
  Color nodeColor=refRenderStyle.getHighlightedNodeColor();
  if (!iArSelectionStorageVertexIDs.isEmpty()) {
    Pathway refTmpPathway=null;
    PathwayVertex refCurrentVertex=null;
    PathwayVertex refTmpVertex=null;
    IPathwayVertexRep refCurrentVertexRep=null;
    Texture refPathwayTexture=null;
    Iterator<PathwayVertex> iterSelectedVertices=iArSelectionStorageVertexIDs.iterator();
    Iterator<Integer> iterSelectedNeighborDistance=iArSelectionStorageNeighborDistance.iterator();
    Iterator<PathwayVertex> iterIdenticalVertices=null;
    Iterator<Pathway> iterDrawnPathways=null;
    while (iterSelectedVertices.hasNext()) {
      fZLayerValue=0.0f;
      refCurrentVertex=iterSelectedVertices.next();
      refPathwayTexture=refHashPathwayToTexture.get(refBasicPathway);
      fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
      fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
      fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
      createVertex(refCurrentVertex.getVertexRepByIndex(iVertexRepIndex),true,nodeColor);
      iterDrawnPathways=refHashPathwayToZLayerValue.keySet().iterator();
      while (iterDrawnPathways.hasNext()) {
        refTmpPathway=iterDrawnPathways.next();
        iterIdenticalVertices=refGeneralManager.getSingelton().getPathwayElementManager().getPathwayVertexListByName(refCurrentVertex.getElementTitle()).iterator();
        while (iterIdenticalVertices.hasNext()) {
          refTmpVertex=iterIdenticalVertices.next();
          if (refTmpPathway.isVertexInPathway(refTmpVertex) == true) {
            fZLayerValue=refHashPathwayToZLayerValue.get(refTmpPathway);
            refCurrentVertexRep=refTmpVertex.getVertexRepByIndex(iVertexRepIndex);
            if (refCurrentVertexRep != null) {
              refPathwayTexture=refHashPathwayToTexture.get(refTmpPathway);
              fPathwayTextureAspectRatio=(float)refPathwayTexture.getImageWidth() / (float)refPathwayTexture.getImageHeight();
              fScalingFactorX=fPathwayTextureAspectRatio / (float)refPathwayTexture.getImageWidth();
              fScalingFactorY=1.0f / (float)refPathwayTexture.getImageHeight();
              createVertex(refCurrentVertexRep,true,nodeColor);
              if (!refTmpPathway.equals(refBasicPathway)) {
                connectVertices(refCurrentVertexRep,refCurrentVertex.getVertexRepByIndex(iVertexRepIndex));
              }
            }
          }
        }
      }
    }
  }
}