Program: 58716
Project: 58716
Buggy source:
private void renderClassAssignmentsGenesLevel2(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fHeightSamples=fHeight / iSamplesLevel2;
  float fFieldWith=viewFrustum.getWidth() / 4.0f * fAnimationScale;
  int iIdxCluster=0;
  int iCounter=iFirstSampleLevel1;
  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 < iSamplesLevel2; 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(-0.1f,fHeight,0);
      gl.glVertex3f(0,fHeight,0);
      gl.glVertex3f(0,fHeight - fHeightSamples * iCnt,0);
      gl.glVertex3f(-0.1f,fHeight - fHeightSamples * iCnt,0);
      gl.glEnd();
      gl.glColor4f(0f,0f,1f,1);
      gl.glLineWidth(1f);
      gl.glBegin(GL.GL_LINES);
      gl.glVertex3f(-0.1f,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glVertex3f(fFieldWith,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(-0.1f,fHeight,0);
  gl.glVertex3f(0,fHeight,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(-0.1f,0,0);
  gl.glEnd();
}

Fixed version (ground truth):
private void renderClassAssignmentsGenesLevel2(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fHeightSamples=fHeight / iSamplesLevel2;
  float fFieldWith=viewFrustum.getWidth() / 4.0f * fAnimationScale;
  int iIdxCluster=0;
  int iCounter=iFirstSampleLevel1;
  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 < iSamplesLevel2; 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(-0.1f,fHeight,0);
      gl.glVertex3f(0,fHeight,0);
      gl.glVertex3f(0,fHeight - fHeightSamples * iCnt,0);
      gl.glVertex3f(-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(-0.1f,fHeight - fHeightSamples * iCnt,0.1f);
      gl.glVertex3f(fFieldWith,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(-0.1f,fHeight,0);
  gl.glVertex3f(0,fHeight,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(-0.1f,0,0);
  gl.glEnd();
  gl.glPopName();
}