Program: 58506
Project: 58506
Buggy source:
/** 
 * Render the coordinate system of the Scatterplot
 * @param gl the gl context
 */
private void renderCoordinateSystem(GL gl){
  textRenderer.setColor(0,0,0,1);
  float fXPosition=XYAXISDISTANCE;
  float fYPosition=XYAXISDISTANCE;
  float fMarkerSpacingY=renderStyle.getAxisHeight() / (NUMBER_AXIS_MARKERS + 1);
  float fMarkerSpacingX=renderStyle.getAxisWidth() / (NUMBER_AXIS_MARKERS + 1);
  for (int iInnerCount=1; iInnerCount <= NUMBER_AXIS_MARKERS + 1; iInnerCount++) {
    float fCurrentHeight=fMarkerSpacingY * iInnerCount;
    float fCurrentWidth=fMarkerSpacingX * iInnerCount;
    if (set.isSetHomogeneous()) {
      float fNumber=(float)set.getRawForNormalized(fCurrentHeight / renderStyle.getAxisHeight());
      Rectangle2D bounds=textRenderer.getScaledBounds(gl,Formatter.formatNumber(fNumber),renderStyle.getSmallFontScalingFactor(),ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
      float fWidth=(float)bounds.getWidth();
      float fHeight=(float)bounds.getHeight();
      float fHeightHalf=fHeight / 2.0f;
      float fWidthHalf=fWidth / 2.0f;
      renderNumber(gl,Formatter.formatNumber(fNumber),fXPosition - fWidth - AXIS_MARKER_WIDTH,fCurrentHeight - fHeightHalf + XYAXISDISTANCE);
      renderNumber(gl,Formatter.formatNumber(fNumber),fCurrentWidth - fWidthHalf + XYAXISDISTANCE,fYPosition - AXIS_MARKER_WIDTH - fHeight);
    }
    gl.glColor4fv(X_AXIS_COLOR,0);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex3f(fCurrentWidth + XYAXISDISTANCE,fYPosition - AXIS_MARKER_WIDTH,AXIS_Z);
    gl.glVertex3f(fCurrentWidth + XYAXISDISTANCE,fYPosition + AXIS_MARKER_WIDTH,AXIS_Z);
    gl.glEnd();
    gl.glColor4fv(Y_AXIS_COLOR,0);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex3f(fXPosition - AXIS_MARKER_WIDTH,fCurrentHeight + XYAXISDISTANCE,AXIS_Z);
    gl.glVertex3f(fXPosition + AXIS_MARKER_WIDTH,fCurrentHeight + XYAXISDISTANCE,AXIS_Z);
    gl.glEnd();
  }
  gl.glColor4fv(X_AXIS_COLOR,0);
  gl.glLineWidth(X_AXIS_LINE_WIDTH);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(XYAXISDISTANCE,XYAXISDISTANCE,0.0f);
  gl.glVertex3f((renderStyle.getRenderWidth() - XYAXISDISTANCE),XYAXISDISTANCE,0.0f);
  gl.glEnd();
  gl.glColor4fv(Y_AXIS_COLOR,0);
  gl.glLineWidth(Y_AXIS_LINE_WIDTH);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(XYAXISDISTANCE,XYAXISDISTANCE,AXIS_Z);
  gl.glVertex3f(XYAXISDISTANCE,renderStyle.getRenderHeight() - XYAXISDISTANCE,AXIS_Z);
  gl.glEnd();
  gl.glTranslatef(renderStyle.getLAbelWidth(),XLABELDISTANCE,0);
  gl.glRotatef(XLABELROTATIONNAGLE,0,0,1);
  textRenderer.begin3DRendering();
  float fScaling=renderStyle.getSmallFontScalingFactor();
  if (isRenderedRemote())   fScaling*=1.5f;
  String sAxisLabel="String_Node_Str" + set.get(SELECTED_X_AXIS).getLabel();
  textRenderer.draw3D(gl,sAxisLabel,0,0,0,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-XLABELROTATIONNAGLE,0,0,1);
  gl.glTranslatef(-renderStyle.getLAbelWidth(),-XLABELDISTANCE,0);
  gl.glTranslatef(YLABELDISTANCE,renderStyle.getLabelHeight(),0);
  gl.glRotatef(YLABELROTATIONNAGLE,0,0,1);
  textRenderer.begin3DRendering();
  fScaling=renderStyle.getSmallFontScalingFactor();
  if (isRenderedRemote())   fScaling*=1.5f;
  sAxisLabel="String_Node_Str" + set.get(SELECTED_Y_AXIS).getLabel();
  textRenderer.draw3D(gl,sAxisLabel,0,0,0,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-YLABELROTATIONNAGLE,0,0,1);
  gl.glTranslatef(-YLABELDISTANCE,-renderStyle.getLabelHeight(),0);
}

Fixed version (ground truth):
/** 
 * Render the coordinate system of the Scatterplot
 * @param gl the gl context
 */
private void renderCoordinateSystem(GL gl){
  textRenderer.setColor(0,0,0,1);
  float fXPosition=XYAXISDISTANCE;
  float fYPosition=XYAXISDISTANCE;
  float fMarkerSpacingY=renderStyle.getAxisHeight() / (NUMBER_AXIS_MARKERS + 1);
  float fMarkerSpacingX=renderStyle.getAxisWidth() / (NUMBER_AXIS_MARKERS + 1);
  for (int iInnerCount=1; iInnerCount <= NUMBER_AXIS_MARKERS + 1; iInnerCount++) {
    float fCurrentHeight=fMarkerSpacingY * iInnerCount;
    float fCurrentWidth=fMarkerSpacingX * iInnerCount;
    if (set.isSetHomogeneous()) {
      float fNumber=(float)set.getRawForNormalized(fCurrentHeight / renderStyle.getAxisHeight());
      Rectangle2D bounds=textRenderer.getScaledBounds(gl,Formatter.formatNumber(fNumber),renderStyle.getSmallFontScalingFactor(),ScatterPlotRenderStyle.MIN_NUMBER_TEXT_SIZE);
      float fWidth=(float)bounds.getWidth();
      float fHeight=(float)bounds.getHeight();
      float fHeightHalf=fHeight / 2.0f;
      float fWidthHalf=fWidth / 2.0f;
      renderNumber(gl,Formatter.formatNumber(fNumber),fXPosition - fWidth - AXIS_MARKER_WIDTH,fCurrentHeight - fHeightHalf + XYAXISDISTANCE);
      gl.glPushAttrib(GL.GL_CURRENT_BIT | GL.GL_LINE_BIT);
      float x=fCurrentWidth - fWidthHalf + XYAXISDISTANCE;
      float y=fYPosition - AXIS_MARKER_WIDTH - fHeight;
      renderNumber(gl,Formatter.formatNumber(fNumber),x,y);
      gl.glPopAttrib();
    }
    gl.glColor4fv(X_AXIS_COLOR,0);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex3f(fCurrentWidth + XYAXISDISTANCE,fYPosition - AXIS_MARKER_WIDTH,AXIS_Z);
    gl.glVertex3f(fCurrentWidth + XYAXISDISTANCE,fYPosition + AXIS_MARKER_WIDTH,AXIS_Z);
    gl.glEnd();
    gl.glColor4fv(Y_AXIS_COLOR,0);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex3f(fXPosition - AXIS_MARKER_WIDTH,fCurrentHeight + XYAXISDISTANCE,AXIS_Z);
    gl.glVertex3f(fXPosition + AXIS_MARKER_WIDTH,fCurrentHeight + XYAXISDISTANCE,AXIS_Z);
    gl.glEnd();
  }
  gl.glColor4fv(X_AXIS_COLOR,0);
  gl.glLineWidth(X_AXIS_LINE_WIDTH);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(XYAXISDISTANCE,XYAXISDISTANCE,0.0f);
  gl.glVertex3f((renderStyle.getRenderWidth() - XYAXISDISTANCE),XYAXISDISTANCE,0.0f);
  gl.glEnd();
  gl.glColor4fv(Y_AXIS_COLOR,0);
  gl.glLineWidth(Y_AXIS_LINE_WIDTH);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(XYAXISDISTANCE,XYAXISDISTANCE,AXIS_Z);
  gl.glVertex3f(XYAXISDISTANCE,renderStyle.getRenderHeight() - XYAXISDISTANCE,AXIS_Z);
  gl.glEnd();
  if (bRenderMatrix)   gl.glTranslatef(renderStyle.getLAbelWidth(),-2 * XLABELDISTANCE,0);
 else   gl.glTranslatef(renderStyle.getLAbelWidth(),XLABELDISTANCE,0);
  gl.glRotatef(XLABELROTATIONNAGLE,0,0,1);
  textRenderer.begin3DRendering();
  float fScaling=renderStyle.getSmallFontScalingFactor();
  if (isRenderedRemote())   fScaling*=1.5f;
  String sAxisLabel="String_Node_Str" + set.get(SELECTED_X_AXIS).getLabel();
  textRenderer.draw3D(gl,sAxisLabel,0,0,0,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-XLABELROTATIONNAGLE,0,0,1);
  if (bRenderMatrix)   gl.glTranslatef(-renderStyle.getLAbelWidth(),+2 * XLABELDISTANCE,0);
 else   gl.glTranslatef(-renderStyle.getLAbelWidth(),-XLABELDISTANCE,0);
  if (bRenderMatrix)   gl.glTranslatef(-YLABELDISTANCE,renderStyle.getLabelHeight(),0);
 else   gl.glTranslatef(YLABELDISTANCE,renderStyle.getLabelHeight(),0);
  gl.glRotatef(YLABELROTATIONNAGLE,0,0,1);
  textRenderer.begin3DRendering();
  fScaling=renderStyle.getSmallFontScalingFactor();
  if (isRenderedRemote())   fScaling*=1.5f;
  sAxisLabel="String_Node_Str" + set.get(SELECTED_Y_AXIS).getLabel();
  textRenderer.draw3D(gl,sAxisLabel,0,0,0,fScaling,ScatterPlotRenderStyle.MIN_AXIS_LABEL_TEXT_SIZE);
  textRenderer.end3DRendering();
  gl.glRotatef(-YLABELROTATIONNAGLE,0,0,1);
  if (bRenderMatrix)   gl.glTranslatef(YLABELDISTANCE,-renderStyle.getLabelHeight(),0);
 else   gl.glTranslatef(-YLABELDISTANCE,-renderStyle.getLabelHeight(),0);
}