Program: 58717
Project: 58717
Buggy source:
private void renderClassAssignmentsGenesLevel3(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fHeightSamples=fHeight / iSamplesPerHeatmap;
  float fOffsetX=0;
  if (bSkipLevel2 == false)   fOffsetX=GAP_LEVEL2_3;
  int iIdxCluster=0;
  int iCounter=iFirstSampleLevel1 + iFirstSampleLevel2;
  Group group=contentVA.getGroupList().get(iIdxCluster);
  while (group.getNrElements() < iCounter) {
    iIdxCluster++;
    iCounter-=group.getNrElements();
    group=contentVA.getGroupList().get(iIdxCluster);
  }
  int iCnt=0;
  for (int i=0; i < iSamplesPerHeatmap; i++) {
    if (iCounter == contentVA.getGroupList().get(iIdxCluster).getNrElements()) {
      if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.NORMAL)       gl.glColor4f(0f,0f,1f,0.5f);
      if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.SELECTION)       gl.glColor4f(0f,1f,0f,0.5f);
      gl.glBegin(GL.GL_QUADS);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight,0);
      gl.glVertex3f(fOffsetX,fHeight,0);
      gl.glVertex3f(fOffsetX,fHeight - fHeightSamples * iCnt,0);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight - fHeightSamples * iCnt,0);
      gl.glEnd();
      gl.glColor4f(0f,0f,1f,1);
      gl.glLineWidth(1f);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glVertex3f(fOffsetX + fWidthEHM,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glEnd();
      fHeight-=fHeightSamples * iCnt;
      iIdxCluster++;
      iCounter=0;
      iCnt=0;
    }
    iCnt++;
    iCounter++;
  }
  if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.NORMAL)   gl.glColor4f(0f,0f,1f,0.5f);
  if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.SELECTION)   gl.glColor4f(0f,1f,0f,0.5f);
  gl.glBegin(GL.GL_QUADS);
  gl.glVertex3f(fOffsetX - 0.1f,fHeight,0);
  gl.glVertex3f(fOffsetX,fHeight,0);
  gl.glVertex3f(fOffsetX,0,0);
  gl.glVertex3f(fOffsetX - 0.1f,0,0);
  gl.glEnd();
}

Fixed version (ground truth):
private void renderClassAssignmentsGenesLevel3(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fHeightSamples=fHeight / iSamplesPerHeatmap;
  float fOffsetX=0;
  if (bSkipLevel2 == false)   fOffsetX=GAP_LEVEL2_3;
  int iIdxCluster=0;
  int iCounter=iFirstSampleLevel1 + iFirstSampleLevel2;
  Group group=contentVA.getGroupList().get(iIdxCluster);
  while (group.getNrElements() < iCounter) {
    iIdxCluster++;
    iCounter-=group.getNrElements();
    group=contentVA.getGroupList().get(iIdxCluster);
  }
  int iCnt=0;
  for (int i=0; i < iSamplesPerHeatmap; i++) {
    if (iCounter == contentVA.getGroupList().get(iIdxCluster).getNrElements()) {
      if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.NORMAL)       gl.glColor4f(0f,0f,1f,0.5f);
      if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.SELECTION)       gl.glColor4f(0f,1f,0f,0.5f);
      gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.HIER_HEAT_MAP_GENES_GROUP,iIdxCluster));
      gl.glBegin(GL.GL_QUADS);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight,0);
      gl.glVertex3f(fOffsetX,fHeight,0);
      gl.glVertex3f(fOffsetX,fHeight - fHeightSamples * iCnt,0);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight - fHeightSamples * iCnt,0);
      gl.glEnd();
      gl.glPopName();
      gl.glColor4f(0f,0f,1f,1);
      gl.glLineWidth(1f);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(fOffsetX - 0.1f,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glVertex3f(fOffsetX + fWidthEHM,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glEnd();
      fHeight-=fHeightSamples * iCnt;
      iIdxCluster++;
      iCounter=0;
      iCnt=0;
    }
    iCnt++;
    iCounter++;
  }
  if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.NORMAL)   gl.glColor4f(0f,0f,1f,0.5f);
  if (contentVA.getGroupList().get(iIdxCluster).getSelectionType() == ESelectionType.SELECTION)   gl.glColor4f(0f,1f,0f,0.5f);
  gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.HIER_HEAT_MAP_GENES_GROUP,iIdxCluster));
  gl.glBegin(GL.GL_QUADS);
  gl.glVertex3f(fOffsetX - 0.1f,fHeight,0);
  gl.glVertex3f(fOffsetX,fHeight,0);
  gl.glVertex3f(fOffsetX,0,0);
  gl.glVertex3f(fOffsetX - 0.1f,0,0);
  gl.glEnd();
  gl.glPopName();
}