Program: 56920
Project: 56920
Buggy source:
/** 
 * Render the histogram itself
 * @param gl
 */
private void renderHistogram(GL2 gl){
  if (histogram == null) {
    if (dataDomain != null && tablePerspective != null) {
      histogram=tablePerspective.getContainerStatistics().getHistogram();
    }
 else     if (dataDomain != null) {
      TablePerspective defaultTablePerspective=dataDomain.getDefaultTablePerspective();
      histogram=defaultTablePerspective.getContainerStatistics().getHistogram();
    }
 else {
      return;
    }
  }
  float spacing=(viewFrustum.getWidth() - 2 * sideSpacing) / histogram.size();
  float continuousColorDistance=1.0f / histogram.size();
  float fOneHeightValue=(viewFrustum.getHeight() - 2 * sideSpacing) / histogram.getLargestValue();
  int iCount=0;
  for (int bucketCount=0; bucketCount < histogram.size(); bucketCount++) {
    Integer iValue=histogram.get(bucketCount);
    if (useColor) {
      float[] color;
      if (dataDomain.getTable() instanceof CategoricalTable<?>) {
        CategoricalTable<?> cTable=(CategoricalTable<?>)dataDomain.getTable();
        color=cTable.getCategoryDescriptions().getCategoryProperties().get(bucketCount).getColor().getRGBA();
      }
 else {
        color=dataDomain.getColorMapper().getColor(continuousColorDistance * iCount + continuousColorDistance / 2);
      }
      gl.glColor3fv(color,0);
    }
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing,0);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing,0);
    gl.glEnd();
    gl.glLineWidth(0.3f);
    gl.glColor3fv(Color.DARK_GRAY.getRGBA(),0);
    gl.glBegin(GL.GL_LINE_LOOP);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing,0);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing,0);
    gl.glEnd();
    iCount++;
  }
}

Fixed version (ground truth):
/** 
 * Render the histogram itself
 * @param gl
 */
private void renderHistogram(GL2 gl){
  if (histogram == null) {
    if (dataDomain != null && tablePerspective != null) {
      histogram=tablePerspective.getContainerStatistics().getHistogram();
    }
 else     if (dataDomain != null) {
      TablePerspective defaultTablePerspective=dataDomain.getDefaultTablePerspective();
      histogram=defaultTablePerspective.getContainerStatistics().getHistogram();
    }
 else {
      return;
    }
  }
  float spacing=(viewFrustum.getWidth() - 2 * sideSpacing) / histogram.size();
  float continuousColorDistance=1.0f / histogram.size();
  float fOneHeightValue=(viewFrustum.getHeight() - 2 * sideSpacing) / histogram.getLargestValue();
  int iCount=0;
  for (int bucketCount=0; bucketCount < histogram.size(); bucketCount++) {
    Integer iValue=histogram.get(bucketCount);
    if (useColor) {
      float[] color;
      if (dataDomain.getTable() instanceof CategoricalTable<?>) {
        CategoricalTable<?> cTable=(CategoricalTable<?>)dataDomain.getTable();
        color=cTable.getCategoryDescriptions().getCategoryProperties().get(bucketCount).getColor().getRGBA();
      }
 else       if (!dataDomain.getTable().isDataHomogeneous() && tablePerspective != null) {
        CategoricalClassDescription<?> specific=(CategoricalClassDescription<?>)dataDomain.getTable().getDataClassSpecificDescription(tablePerspective.getDimensionPerspective().getVirtualArray().get(0),tablePerspective.getRecordPerspective().getVirtualArray().get(0));
        color=specific.getCategoryProperties().get(bucketCount).getColor().getRGBA();
      }
 else {
        color=dataDomain.getColorMapper().getColor(continuousColorDistance * iCount + continuousColorDistance / 2);
      }
      gl.glColor3fv(color,0);
    }
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing,0);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing,0);
    gl.glEnd();
    gl.glLineWidth(0.3f);
    gl.glColor3fv(Color.DARK_GRAY.getRGBA(),0);
    gl.glBegin(GL.GL_LINE_LOOP);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing,0);
    gl.glVertex3f(spacing * iCount + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing + iValue * fOneHeightValue,0);
    gl.glVertex3f(spacing * (iCount + 1) + sideSpacing,sideSpacing,0);
    gl.glEnd();
    iCount++;
  }
}