Program: 58661
Project: 58661
Buggy source:
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  if (bRedrawTextures) {
    initTextures(gl);
    bRedrawTextures=false;
  }
  if (bHasFrustumChanged) {
    glHeatMapView.setDisplayListDirty();
    glGeneDendrogramView.setDisplayListDirty();
    glExperimentDendrogramView.setDisplayListDirty();
    bHasFrustumChanged=false;
  }
  gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glLoadIdentity();
  gl.glColor4f(0,0,0,0.15f);
  gl.glBegin(GL.GL_QUADS);
  gl.glVertex3f(0,0,-0.1f);
  gl.glVertex3f(viewFrustum.getRight(),0,-0.1f);
  gl.glVertex3f(viewFrustum.getRight(),viewFrustum.getHeight(),-0.1f);
  gl.glVertex3f(0,viewFrustum.getHeight(),-0.1f);
  gl.glEnd();
  viewFrustum.setTop(viewFrustum.getTop() - 0.6f);
  viewFrustum.setLeft(viewFrustum.getLeft() + 0.1f);
  gl.glTranslatef(0.1f,0.4f,0);
  if (bGeneDendrogramActive)   gl.glTranslatef(1.58f,0,0);
  renderDendrogramButton(gl);
  if (contentVA.getGroupList() != null && bSkipLevel1 == false)   renderClassAssignmentsGenesLevel1(gl);
  if (bSkipLevel1 == false) {
    handleTexturePickingLevel1(gl);
    renderOverviewBar(gl);
    renderMarkerOverviewBar(gl);
    renderSelectedElementsOverviewBar(gl);
    renderCursorLevel1(gl);
    gl.glTranslatef(GAP_LEVEL1_2 / 2,0,0);
    float fHeightSubTree=viewFrustum.getHeight();
    int lastIndexOfSubTree=0;
    try {
      lastIndexOfSubTree=contentVA.get(iLastSampleLevel1 + 1);
    }
 catch (    IndexOutOfBoundsException e) {
      try {
        lastIndexOfSubTree=contentVA.get(iLastSampleLevel1);
      }
 catch (      IndexOutOfBoundsException e1) {
        lastIndexOfSubTree=contentVA.get(iLastSampleLevel1 - 1);
      }
    }
    glGeneDendrogramView.renderSubTreeFromIndexToIndex(gl,contentVA.get(iFirstSampleLevel1),lastIndexOfSubTree,iSamplesLevel2,GAP_LEVEL1_2 / 2,fHeightSubTree);
    gl.glTranslatef(GAP_LEVEL1_2 / 2,0,0);
    gl.glColor4f(1f,1f,1f,1f);
  }
 else {
    gl.glColor4f(1f,1f,1f,1f);
  }
  if (bIsHeatmapInFocus || bGeneDendrogramActive) {
    fAnimationScale=0.2f;
  }
 else {
    fAnimationScale=1.0f;
  }
  if (bSkipLevel2 == false) {
    handleTexturePickingLevel2(gl);
    renderTextureHeatMap(gl);
    renderMarkerTexture(gl);
    renderSelectedElementsTexture(gl);
    if (contentVA.getGroupList() != null)     renderClassAssignmentsGenesLevel2(gl);
    if (storageVA.getGroupList() != null)     renderClassAssignmentsExperimentsLevel2(gl);
    gl.glTranslatef(viewFrustum.getWidth() / 4.0f * fAnimationScale + GAP_LEVEL2_3 / 2,0,0);
    float fHeightSubTree=0;
    if (bExperimentDendrogramActive)     fHeightSubTree=viewFrustum.getHeight() - 1.45f;
 else     fHeightSubTree=viewFrustum.getHeight();
    int lastIndexOfSubTree=0;
    try {
      lastIndexOfSubTree=contentVA.get(iFirstSampleLevel1 + iLastSampleLevel2 + 1);
    }
 catch (    IndexOutOfBoundsException e) {
      lastIndexOfSubTree=contentVA.get(iFirstSampleLevel1 + iLastSampleLevel2);
    }
    glGeneDendrogramView.renderSubTreeFromIndexToIndex(gl,contentVA.get(iFirstSampleLevel1 + iFirstSampleLevel2),lastIndexOfSubTree,iSamplesPerHeatmap,GAP_LEVEL2_3 / 2,fHeightSubTree);
    gl.glTranslatef(-(viewFrustum.getWidth() / 4.0f * fAnimationScale + GAP_LEVEL2_3 / 2),0,0);
  }
  setEmbeddedHeatMapData();
  if (bSkipLevel2 == false) {
    gl.glTranslatef(viewFrustum.getWidth() / 4.0f * fAnimationScale,0,0);
    renderCursorLevel2(gl);
  }
  if (contentVA.getGroupList() != null)   renderClassAssignmentsGenesLevel3(gl);
  if (bSkipLevel2 == false)   gl.glTranslatef(-(viewFrustum.getWidth() / 4.0f * fAnimationScale),0,0);
  if (storageVA.getGroupList() != null) {
    renderClassAssignmentsExperimentsLevel3(gl);
  }
  if (bSkipLevel1 == false) {
    gl.glTranslatef(-GAP_LEVEL1_2,0,0);
  }
  if (bGeneDendrogramActive)   gl.glTranslatef(-1.58f,0,0);
  gl.glTranslatef(-0.1f,-0.4f,0);
  viewFrustum.setTop(viewFrustum.getTop() + 0.6f);
  viewFrustum.setLeft(viewFrustum.getLeft() - 0.1f);
  gl.glEndList();
}

Fixed version (ground truth):
private void buildDisplayList(final GL gl,int iGLDisplayListIndex){
  if (bRedrawTextures) {
    initTextures(gl);
    bRedrawTextures=false;
  }
  if (bHasFrustumChanged) {
    glHeatMapView.setDisplayListDirty();
    glGeneDendrogramView.setDisplayListDirty();
    glExperimentDendrogramView.setDisplayListDirty();
    bHasFrustumChanged=false;
  }
  gl.glNewList(iGLDisplayListIndex,GL.GL_COMPILE);
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glLoadIdentity();
  gl.glColor4f(0,0,0,0.15f);
  gl.glBegin(GL.GL_QUADS);
  gl.glVertex3f(0,0,-0.1f);
  gl.glVertex3f(viewFrustum.getRight(),0,-0.1f);
  gl.glVertex3f(viewFrustum.getRight(),viewFrustum.getHeight(),-0.1f);
  gl.glVertex3f(0,viewFrustum.getHeight(),-0.1f);
  gl.glEnd();
  viewFrustum.setTop(viewFrustum.getTop() - 0.6f);
  viewFrustum.setLeft(viewFrustum.getLeft() + 0.1f);
  gl.glTranslatef(0.1f,0.4f,0);
  if (bGeneDendrogramActive)   gl.glTranslatef(1.58f,0,0);
  renderDendrogramButton(gl);
  if (contentVA.getGroupList() != null && bSkipLevel1 == false)   renderClassAssignmentsGenesLevel1(gl);
  if (bSkipLevel1 == false) {
    handleTexturePickingLevel1(gl);
    renderOverviewBar(gl);
    renderMarkerOverviewBar(gl);
    renderSelectedElementsOverviewBar(gl);
    renderCursorLevel1(gl);
    gl.glTranslatef(GAP_LEVEL1_2 / 2,0,0);
    float fHeightSubTree=viewFrustum.getHeight();
    int lastIndexOfSubTree=0;
    try {
      lastIndexOfSubTree=contentVA.get(iLastSampleLevel1 + 1);
    }
 catch (    IndexOutOfBoundsException e) {
      try {
        lastIndexOfSubTree=contentVA.get(iLastSampleLevel1);
      }
 catch (      IndexOutOfBoundsException e1) {
        lastIndexOfSubTree=contentVA.get(iLastSampleLevel1 - 1);
      }
    }
    glGeneDendrogramView.renderSubTreeFromIndexToIndex(gl,contentVA.get(iFirstSampleLevel1),lastIndexOfSubTree,iSamplesLevel2,GAP_LEVEL1_2 / 2,fHeightSubTree);
    gl.glTranslatef(GAP_LEVEL1_2 / 2,0,0);
    gl.glColor4f(1f,1f,1f,1f);
  }
 else {
    gl.glColor4f(1f,1f,1f,1f);
  }
  if (bIsHeatmapInFocus || bGeneDendrogramActive) {
    fAnimationScale=0.2f;
  }
 else {
    fAnimationScale=1.0f;
  }
  if (bSkipLevel2 == false) {
    handleTexturePickingLevel2(gl);
    renderTextureHeatMap(gl);
    renderMarkerTexture(gl);
    renderSelectedElementsTexture(gl);
    if (contentVA.getGroupList() != null)     renderClassAssignmentsGenesLevel2(gl);
    if (storageVA.getGroupList() != null)     renderClassAssignmentsExperimentsLevel2(gl);
    gl.glTranslatef(viewFrustum.getWidth() / 4.0f * fAnimationScale + GAP_LEVEL2_3 / 2,0,0);
    float fHeightSubTree=0;
    if (bExperimentDendrogramActive)     fHeightSubTree=viewFrustum.getHeight() - 1.45f;
 else     fHeightSubTree=viewFrustum.getHeight();
    int lastIndexOfSubTree=0;
    try {
      lastIndexOfSubTree=contentVA.get(iFirstSampleLevel1 + iLastSampleLevel2 + 1);
    }
 catch (    IndexOutOfBoundsException e) {
      try {
        lastIndexOfSubTree=contentVA.get(iFirstSampleLevel1 + iLastSampleLevel2);
      }
 catch (      IndexOutOfBoundsException e1) {
        lastIndexOfSubTree=contentVA.get(iFirstSampleLevel1 + iLastSampleLevel2 - 1);
      }
    }
    glGeneDendrogramView.renderSubTreeFromIndexToIndex(gl,contentVA.get(iFirstSampleLevel1 + iFirstSampleLevel2),lastIndexOfSubTree,iSamplesPerHeatmap,GAP_LEVEL2_3 / 2,fHeightSubTree);
    gl.glTranslatef(-(viewFrustum.getWidth() / 4.0f * fAnimationScale + GAP_LEVEL2_3 / 2),0,0);
  }
  setEmbeddedHeatMapData();
  if (bSkipLevel2 == false) {
    gl.glTranslatef(viewFrustum.getWidth() / 4.0f * fAnimationScale,0,0);
    renderCursorLevel2(gl);
  }
  if (contentVA.getGroupList() != null)   renderClassAssignmentsGenesLevel3(gl);
  if (bSkipLevel2 == false)   gl.glTranslatef(-(viewFrustum.getWidth() / 4.0f * fAnimationScale),0,0);
  if (storageVA.getGroupList() != null) {
    renderClassAssignmentsExperimentsLevel3(gl);
  }
  if (bSkipLevel1 == false) {
    gl.glTranslatef(-GAP_LEVEL1_2,0,0);
  }
  if (bGeneDendrogramActive)   gl.glTranslatef(-1.58f,0,0);
  gl.glTranslatef(-0.1f,-0.4f,0);
  viewFrustum.setTop(viewFrustum.getTop() + 0.6f);
  viewFrustum.setLeft(viewFrustum.getLeft() - 0.1f);
  gl.glEndList();
}