Program: 58798
Project: 58798
Buggy source:
private void renderHeatMap(final GL gl){
  fAlXDistances.clear();
  renderStyle.updateFieldSizes();
  float fXPosition=0;
  float fYPosition=0;
  float fFieldWidth=0;
  float fFieldHeight=0;
  int iCount=0;
  ESelectionType currentType;
  for (  Integer iContentIndex : set.getVA(iContentVAID)) {
    iCount++;
    if (contentSelectionManager.checkStatus(ESelectionType.NORMAL,iContentIndex) || contentSelectionManager.checkStatus(ESelectionType.DESELECTED,iContentIndex)) {
      fFieldWidth=renderStyle.getNormalFieldWidth();
      fFieldHeight=renderStyle.getFieldHeight();
      currentType=ESelectionType.NORMAL;
    }
 else     if (contentSelectionManager.checkStatus(ESelectionType.SELECTION,iContentIndex) || contentSelectionManager.checkStatus(ESelectionType.MOUSE_OVER,iContentIndex)) {
      fFieldWidth=renderStyle.getSelectedFieldWidth();
      fFieldHeight=renderStyle.getFieldHeight();
      currentType=ESelectionType.SELECTION;
    }
 else {
      continue;
    }
    if (listModeEnabled) {
      fYPosition=HeatMapRenderStyle.LIST_SPACING;
    }
 else {
      fYPosition=0;
    }
    for (    Integer iStorageIndex : set.getVA(iStorageVAID)) {
      if (listModeEnabled) {
        if (currentType == ESelectionType.SELECTION) {
          if (iCurrentMouseOverElement == iContentIndex) {
            renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 3,fYPosition,fFieldWidth / 2,fFieldHeight);
          }
 else {
            renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 2f,fYPosition,fFieldWidth / 2.5f,fFieldHeight);
          }
        }
 else {
          renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 2,fYPosition,fFieldWidth / 2,fFieldHeight);
        }
      }
 else {
        renderElement(gl,iStorageIndex,iContentIndex,fXPosition,fYPosition,fFieldWidth,fFieldHeight);
      }
      fYPosition+=fFieldHeight;
    }
    float fFontScaling=0;
    float fColumnDegrees=0;
    float fLineDegrees=0;
    if (bRenderStorageHorizontally) {
      fColumnDegrees=0;
      fLineDegrees=25;
    }
 else {
      fColumnDegrees=60;
      fLineDegrees=90;
    }
    if (fFieldWidth > 0.1f) {
      boolean bRenderRefSeq=false;
      fFontScaling=renderStyle.getSmallFontScalingFactor();
      if (detailLevel == EDetailLevel.HIGH) {
        bRenderRefSeq=true;
        String sContent;
        if (set.getSetType() == ESetType.GENE_EXPRESSION_DATA) {
          sContent=GeneticIDMappingHelper.get().getShortNameFromExpressionIndex(iContentIndex);
          if (bRenderRefSeq) {
            sContent+="String_Node_Str";
            sContent+=GeneticIDMappingHelper.get().getRefSeqStringFromStorageIndex(iContentIndex);
          }
        }
 else         if (set.getSetType() == ESetType.UNSPECIFIED) {
          sContent=generalManager.getIDMappingManager().getID(EMappingType.EXPRESSION_INDEX_2_UNSPECIFIED,iContentIndex);
        }
 else {
          throw new IllegalStateException("String_Node_Str" + set.getSetType() + "String_Node_Str");
        }
        if (sContent == null)         sContent="String_Node_Str";
        if (listModeEnabled) {
          if (currentType == ESelectionType.SELECTION) {
            if (iCurrentMouseOverElement == iContentIndex) {
              iCurrentMouseOverElement=-1;
              float fTextScalingFactor=0.0035f;
              float fTextSpacing=0.1f;
              float fYSelectionOrigin=-2 * fTextSpacing - (float)textRenderer.getBounds(sContent).getWidth() * fTextScalingFactor;
              float fSlectionFieldHeight=-fYSelectionOrigin + renderStyle.getRenderHeight();
              gl.glColor3f(0.25f,0.25f,0.25f);
              gl.glBegin(GL.GL_POLYGON);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glEnd();
              textRenderer.setColor(1,1,1,1);
              gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
              gl.glTranslatef(fXPosition + fFieldWidth / 1.5f,fYSelectionOrigin + fTextSpacing,0);
              gl.glRotatef(+fLineDegrees,0,0,1);
              textRenderer.begin3DRendering();
              textRenderer.draw3D(sContent,0,0,0.016f,fTextScalingFactor);
              textRenderer.end3DRendering();
              gl.glRotatef(-fLineDegrees,0,0,1);
              gl.glTranslatef(-fXPosition - fFieldWidth / 1.5f,-fYSelectionOrigin - fTextSpacing,0);
              gl.glPopAttrib();
            }
 else {
              float fYSelectionOrigin=0;
              float fSlectionFieldHeight=-fYSelectionOrigin + renderStyle.getRenderHeight();
              gl.glColor3f(0.25f,0.25f,0.25f);
              gl.glBegin(GL.GL_POLYGON);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glEnd();
              textRenderer.setColor(1,1,1,1);
              renderCaption(gl,sContent,fXPosition + fFieldWidth / 2.2f - 0.01f,0 + 0.01f + HeatMapRenderStyle.LIST_SPACING,0.02f,fLineDegrees,fFontScaling);
              gl.glPopAttrib();
            }
          }
 else {
            textRenderer.setColor(0,0,0,1);
            renderCaption(gl,sContent,fXPosition + fFieldWidth / 2 - 0.01f,0 + 0.01f + HeatMapRenderStyle.LIST_SPACING,0,fLineDegrees,fFontScaling);
          }
        }
 else {
          textRenderer.setColor(0,0,0,1);
          renderCaption(gl,sContent,fXPosition + fFieldWidth / 6 * 4.5f,fYPosition + 0.1f,0,fLineDegrees,fFontScaling);
        }
      }
    }
    fAlXDistances.add(fXPosition);
    fXPosition+=fFieldWidth;
    if (detailLevel == EDetailLevel.HIGH && !listModeEnabled) {
      if (iCount == set.getVA(iContentVAID).size()) {
        fYPosition=0;
        for (        Integer iStorageIndex : set.getVA(iStorageVAID)) {
          textRenderer.setColor(0,0,0,1);
          renderCaption(gl,set.get(iStorageIndex).getLabel(),fXPosition + 0.1f,fYPosition + fFieldHeight / 2,0,fColumnDegrees,renderStyle.getSmallFontScalingFactor());
          fYPosition+=fFieldHeight;
        }
      }
    }
  }
}

Fixed version (ground truth):
private void renderHeatMap(final GL gl){
  fAlXDistances.clear();
  renderStyle.updateFieldSizes();
  float fXPosition=0;
  float fYPosition=0;
  float fFieldWidth=0;
  float fFieldHeight=0;
  int iCount=0;
  ESelectionType currentType;
  for (  Integer iContentIndex : set.getVA(iContentVAID)) {
    iCount++;
    if (contentSelectionManager.checkStatus(ESelectionType.NORMAL,iContentIndex) || contentSelectionManager.checkStatus(ESelectionType.DESELECTED,iContentIndex)) {
      fFieldWidth=renderStyle.getNormalFieldWidth();
      fFieldHeight=renderStyle.getFieldHeight();
      currentType=ESelectionType.NORMAL;
    }
 else     if (contentSelectionManager.checkStatus(ESelectionType.SELECTION,iContentIndex) || contentSelectionManager.checkStatus(ESelectionType.MOUSE_OVER,iContentIndex)) {
      fFieldWidth=renderStyle.getSelectedFieldWidth();
      fFieldHeight=renderStyle.getFieldHeight();
      currentType=ESelectionType.SELECTION;
    }
 else {
      continue;
    }
    if (listModeEnabled) {
      fYPosition=HeatMapRenderStyle.LIST_SPACING;
    }
 else {
      fYPosition=0;
    }
    for (    Integer iStorageIndex : set.getVA(iStorageVAID)) {
      if (listModeEnabled) {
        if (currentType == ESelectionType.SELECTION) {
          if (iCurrentMouseOverElement == iContentIndex) {
            renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 3,fYPosition,fFieldWidth / 2,fFieldHeight);
          }
 else {
            renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 2f,fYPosition,fFieldWidth / 2.5f,fFieldHeight);
          }
        }
 else {
          renderElement(gl,iStorageIndex,iContentIndex,fXPosition + fFieldWidth / 2,fYPosition,fFieldWidth / 2,fFieldHeight);
        }
      }
 else {
        renderElement(gl,iStorageIndex,iContentIndex,fXPosition,fYPosition,fFieldWidth,fFieldHeight);
      }
      fYPosition+=fFieldHeight;
    }
    float fFontScaling=0;
    float fColumnDegrees=0;
    float fLineDegrees=0;
    if (bRenderStorageHorizontally) {
      fColumnDegrees=0;
      fLineDegrees=25;
    }
 else {
      fColumnDegrees=60;
      fLineDegrees=90;
    }
    if (fFieldWidth > 0.055f) {
      boolean bRenderRefSeq=false;
      fFontScaling=renderStyle.getSmallFontScalingFactor();
      if (detailLevel == EDetailLevel.HIGH) {
        String sContent;
        String refSeq=null;
        if (set.getSetType() == ESetType.GENE_EXPRESSION_DATA) {
          sContent=GeneticIDMappingHelper.get().getShortNameFromExpressionIndex(iContentIndex);
          refSeq=GeneticIDMappingHelper.get().getRefSeqStringFromStorageIndex(iContentIndex);
          if (bRenderRefSeq) {
            sContent+="String_Node_Str";
            sContent+=refSeq;
          }
        }
 else         if (set.getSetType() == ESetType.UNSPECIFIED) {
          sContent=generalManager.getIDMappingManager().getID(EMappingType.EXPRESSION_INDEX_2_UNSPECIFIED,iContentIndex);
        }
 else {
          throw new IllegalStateException("String_Node_Str" + set.getSetType() + "String_Node_Str");
        }
        if (sContent == null)         sContent="String_Node_Str";
        if (listModeEnabled) {
          if (currentType == ESelectionType.SELECTION) {
            if (iCurrentMouseOverElement == iContentIndex) {
              iCurrentMouseOverElement=-1;
              float fTextScalingFactor=0.0035f;
              float fTextSpacing=0.1f;
              float fYSelectionOrigin=-2 * fTextSpacing - (float)textRenderer.getBounds(sContent).getWidth() * fTextScalingFactor;
              float fSlectionFieldHeight=-fYSelectionOrigin + renderStyle.getRenderHeight();
              gl.glColor3f(0.25f,0.25f,0.25f);
              gl.glBegin(GL.GL_POLYGON);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glEnd();
              textRenderer.setColor(1,1,1,1);
              gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
              gl.glTranslatef(fXPosition + fFieldWidth / 1.5f,fYSelectionOrigin + fTextSpacing,0);
              gl.glRotatef(+fLineDegrees,0,0,1);
              textRenderer.begin3DRendering();
              textRenderer.draw3D(sContent,0,0,0.016f,fTextScalingFactor);
              textRenderer.end3DRendering();
              gl.glRotatef(-fLineDegrees,0,0,1);
              gl.glTranslatef(-fXPosition - fFieldWidth / 1.5f,-fYSelectionOrigin - fTextSpacing,0);
              gl.glPopAttrib();
            }
 else {
              float fYSelectionOrigin=0;
              float fSlectionFieldHeight=-fYSelectionOrigin + renderStyle.getRenderHeight();
              gl.glColor3f(0.25f,0.25f,0.25f);
              gl.glBegin(GL.GL_POLYGON);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin,0.0005f);
              gl.glVertex3f(fXPosition + fFieldWidth,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glVertex3f(fXPosition + 0.03f,fYSelectionOrigin + fSlectionFieldHeight,0.0005f);
              gl.glEnd();
              textRenderer.setColor(1,1,1,1);
              renderCaption(gl,sContent,fXPosition + fFieldWidth / 2.2f - 0.01f,0 + 0.01f + HeatMapRenderStyle.LIST_SPACING,0.02f,fLineDegrees,fFontScaling);
              gl.glPopAttrib();
            }
          }
 else {
            textRenderer.setColor(0,0,0,1);
            renderCaption(gl,sContent,fXPosition + fFieldWidth / 2 - 0.01f,0 + 0.01f + HeatMapRenderStyle.LIST_SPACING,0,fLineDegrees,fFontScaling);
          }
        }
 else {
          textRenderer.setColor(0,0,0,1);
          if (currentType == ESelectionType.SELECTION || currentType == ESelectionType.MOUSE_OVER) {
            renderCaption(gl,sContent,fXPosition + fFieldWidth / 6 * 2.5f,fYPosition + 0.1f,0,fLineDegrees,fFontScaling);
            if (refSeq != null)             renderCaption(gl,refSeq,fXPosition + fFieldWidth / 6 * 4.5f,fYPosition + 0.1f,0,fLineDegrees,fFontScaling);
          }
 else {
            renderCaption(gl,sContent,fXPosition + fFieldWidth / 6 * 4.5f,fYPosition + 0.1f,0,fLineDegrees,fFontScaling);
          }
        }
      }
    }
    fAlXDistances.add(fXPosition);
    fXPosition+=fFieldWidth;
    if (detailLevel == EDetailLevel.HIGH && !listModeEnabled) {
      if (iCount == set.getVA(iContentVAID).size()) {
        fYPosition=0;
        for (        Integer iStorageIndex : set.getVA(iStorageVAID)) {
          textRenderer.setColor(0,0,0,1);
          renderCaption(gl,set.get(iStorageIndex).getLabel(),fXPosition + 0.1f,fYPosition + fFieldHeight / 2,0,fColumnDegrees,renderStyle.getSmallFontScalingFactor());
          fYPosition+=fFieldHeight;
        }
      }
    }
  }
}