Program: 57663
Project: 57663
Buggy source:
/** 
 * Render the color bars for selecting the color mapping
 * @param gl
 */
private void renderColorBars(GL2 gl){
  fRenderWidth=(viewFrustum.getWidth() - 2 * sideSpacing);
  ArrayList<ColorMarkerPoint> markerPoints=dataDomain.getColorMapper().getMarkerPoints();
  int iCount=0;
  for (  ColorMarkerPoint markerPoint : markerPoints) {
    int iColorLinePickingID=pickingManager.getPickingID(uniqueID,PickingType.HISTOGRAM_COLOR_LINE,iCount);
    boolean bIsFirstOrLast=false;
    float fPickingScaling=0.8f;
    if (iCount == 0 || iCount == markerPoints.size() - 1)     bIsFirstOrLast=true;
    if (markerPoint.hasLeftSpread()) {
      float fLeftSpread=markerPoint.getLeftSpread();
      int iLeftSpreadPickingID=pickingManager.getPickingID(uniqueID,PickingType.HISTOGRAM_LEFT_SPREAD_COLOR_LINE,iCount);
      gl.glColor4f(markerPoint.getColor()[0],markerPoint.getColor()[1],markerPoint.getColor()[2],0.3f);
      float fLeft=sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth;
      float fRight=sideSpacing + markerPoint.getMappingValue() * fRenderWidth;
      if (!bIsFirstOrLast)       gl.glPushName(iColorLinePickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),sideSpacing,-0.1f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight,viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight,sideSpacing,-0.001f);
      gl.glEnd();
      if (!bIsFirstOrLast)       gl.glPopName();
      gl.glPushName(iLeftSpreadPickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft,sideSpacing,-0.1f);
      gl.glVertex3f(fLeft,viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),sideSpacing,-0.001f);
      gl.glEnd();
      gl.glPopName();
      gl.glColor3fv(SPREAD_LINE_COLOR,0);
      gl.glPushName(iLeftSpreadPickingID);
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth,0,0);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth,viewFrustum.getHeight(),0);
      gl.glEnd();
      gl.glPopName();
      if (fLeftSpread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(gl,markerPoint.getMappingValue() - fLeftSpread);
    }
    if (markerPoint.hasRightSpread()) {
      float fRightSpread=markerPoint.getRightSpread();
      float fLeft=sideSpacing + markerPoint.getMappingValue() * fRenderWidth;
      float fRight=sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth;
      int iRightSpreadPickingID=pickingManager.getPickingID(uniqueID,PickingType.HISTOGRAM_RIGHT_SPREAD_COLOR_LINE,iCount);
      gl.glColor4f(markerPoint.getColor()[0],markerPoint.getColor()[1],markerPoint.getColor()[2],0.3f);
      if (!bIsFirstOrLast)       gl.glPushName(iColorLinePickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft,sideSpacing,-0.011f);
      gl.glVertex3f(fLeft,viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),sideSpacing,-0.1f);
      gl.glEnd();
      if (!bIsFirstOrLast)       gl.glPopName();
      gl.glPushName(iRightSpreadPickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),sideSpacing,-0.011f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight,viewFrustum.getHeight() - sideSpacing,-0.1f);
      gl.glVertex3f(fRight,sideSpacing,-0.1f);
      gl.glEnd();
      gl.glPopName();
      gl.glColor3fv(SPREAD_LINE_COLOR,0);
      gl.glPushName(iRightSpreadPickingID);
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth,0,0);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth,viewFrustum.getHeight(),0);
      gl.glEnd();
      gl.glPopName();
      if (fRightSpread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(gl,markerPoint.getMappingValue() + fRightSpread);
    }
    renderCaption(gl,markerPoint.getMappingValue());
    iCount++;
  }
}

Fixed version (ground truth):
/** 
 * Render the color bars for selecting the color mapping
 * @param gl
 */
private void renderColorBars(GL2 gl){
  fRenderWidth=(viewFrustum.getWidth() - 2 * sideSpacing);
  ArrayList<ColorMarkerPoint> markerPoints=dataDomain.getColorMapper().getMarkerPoints();
  int iCount=0;
  for (  ColorMarkerPoint markerPoint : markerPoints) {
    int iColorLinePickingID=pickingManager.getPickingID(uniqueID,EPickingType.HISTOGRAM_COLOR_LINE.name(),iCount);
    boolean bIsFirstOrLast=false;
    float fPickingScaling=0.8f;
    if (iCount == 0 || iCount == markerPoints.size() - 1)     bIsFirstOrLast=true;
    if (markerPoint.hasLeftSpread()) {
      float fLeftSpread=markerPoint.getLeftSpread();
      int iLeftSpreadPickingID=pickingManager.getPickingID(uniqueID,EPickingType.HISTOGRAM_LEFT_SPREAD_COLOR_LINE.name(),iCount);
      gl.glColor4f(markerPoint.getColor()[0],markerPoint.getColor()[1],markerPoint.getColor()[2],0.3f);
      float fLeft=sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth;
      float fRight=sideSpacing + markerPoint.getMappingValue() * fRenderWidth;
      if (!bIsFirstOrLast)       gl.glPushName(iColorLinePickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),sideSpacing,0.01f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight,viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight,sideSpacing,0.01f);
      gl.glEnd();
      if (!bIsFirstOrLast)       gl.glPopName();
      gl.glPushName(iLeftSpreadPickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft,sideSpacing,0.01f);
      gl.glVertex3f(fLeft,viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight + fPickingScaling * (fLeft - fRight),sideSpacing,0.01f);
      gl.glEnd();
      gl.glPopName();
      gl.glColor3fv(SPREAD_LINE_COLOR,0);
      gl.glPushName(iLeftSpreadPickingID);
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth,0,0.1f);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() - fLeftSpread) * fRenderWidth,viewFrustum.getHeight(),0.1f);
      gl.glEnd();
      gl.glPopName();
      if (fLeftSpread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(gl,markerPoint.getMappingValue() - fLeftSpread);
    }
    if (markerPoint.hasRightSpread()) {
      float fRightSpread=markerPoint.getRightSpread();
      float fLeft=sideSpacing + markerPoint.getMappingValue() * fRenderWidth;
      float fRight=sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth;
      int iRightSpreadPickingID=pickingManager.getPickingID(uniqueID,EPickingType.HISTOGRAM_RIGHT_SPREAD_COLOR_LINE.name(),iCount);
      gl.glColor4f(markerPoint.getColor()[0],markerPoint.getColor()[1],markerPoint.getColor()[2],0.3f);
      if (!bIsFirstOrLast)       gl.glPushName(iColorLinePickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft,sideSpacing,0.01f);
      gl.glVertex3f(fLeft,viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),sideSpacing,0.01f);
      gl.glEnd();
      if (!bIsFirstOrLast)       gl.glPopName();
      gl.glPushName(iRightSpreadPickingID);
      gl.glBegin(GL2.GL_POLYGON);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),sideSpacing,0.01f);
      gl.glVertex3f(fLeft + fPickingScaling * (fRight - fLeft),viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight,viewFrustum.getHeight() - sideSpacing,0.01f);
      gl.glVertex3f(fRight,sideSpacing,0.01f);
      gl.glEnd();
      gl.glPopName();
      gl.glColor3fv(SPREAD_LINE_COLOR,0);
      gl.glPushName(iRightSpreadPickingID);
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth,0,0.01f);
      gl.glVertex3f(sideSpacing + (markerPoint.getMappingValue() + fRightSpread) * fRenderWidth,viewFrustum.getHeight(),0.01f);
      gl.glEnd();
      gl.glPopName();
      if (fRightSpread > HistogramRenderStyle.SPREAD_CAPTION_THRESHOLD)       renderCaption(gl,markerPoint.getMappingValue() + fRightSpread);
    }
    renderCaption(gl,markerPoint.getMappingValue());
    iCount++;
  }
}