Program: 57036
Project: 57036
Buggy source:
/** 
 * Draws this glyph and returns the (x) advance for this glyph 
 */
public float draw3D(float inX,float inY,float z,float scaleFactor){
  if (str != null) {
    draw3D_ROBUST(str,inX,inY,z,scaleFactor);
    if (!needAdvance) {
      return 0;
    }
    GlyphVector gv=font.createGlyphVector(getFontRenderContext(),str);
    float totalAdvance=0;
    for (int i=0; i < gv.getNumGlyphs(); i++) {
      totalAdvance+=gv.getGlyphMetrics(i).getAdvance();
    }
    return totalAdvance;
  }
  if (glyphRectForTextureMapping == null) {
    upload();
  }
  try {
    if (mPipelinedQuadRenderer == null) {
      mPipelinedQuadRenderer=new Pipelined_QuadRenderer();
    }
    TextureRenderer renderer=getBackingStore();
    float xScale=1;
    float yScale=1;
    Rect rect=glyphRectForTextureMapping;
    TextData data=(TextData)rect.getUserData();
    data.markUsed();
    Rectangle2D origRect=data.origRect();
    float x=inX - (scaleFactor * data.origOriginX());
    float y=inY - (scaleFactor * ((float)origRect.getHeight() - data.origOriginY()));
    int texturex=rect.x() + (data.origin().x - data.origOriginX());
    int texturey=renderer.getHeight() - rect.y() - (int)origRect.getHeight()- (data.origin().y - data.origOriginY());
    int width=(int)origRect.getWidth();
    int height=(int)origRect.getHeight();
    float tx1=xScale * texturex / renderer.getWidth();
    float ty1=yScale * (1.0f - (texturey / (float)renderer.getHeight()));
    float tx2=xScale * (texturex + width) / renderer.getWidth();
    float ty2=yScale * (1.0f - ((texturey + height) / (float)renderer.getHeight()));
    mPipelinedQuadRenderer.glTexCoord2f(tx1,ty1);
    mPipelinedQuadRenderer.glVertex3f(x,y,z);
    mPipelinedQuadRenderer.glTexCoord2f(tx2,ty1);
    mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor),y,z);
    mPipelinedQuadRenderer.glTexCoord2f(tx2,ty2);
    mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor),y + (height * scaleFactor),z);
    mPipelinedQuadRenderer.glTexCoord2f(tx1,ty2);
    mPipelinedQuadRenderer.glVertex3f(x,y + (height * scaleFactor),z);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return advance;
}

Fixed version (ground truth):
/** 
 * Draws this glyph and returns the (x) advance for this glyph 
 */
public float draw3D(float inX,float inY,float z,float scaleFactor){
  if (str != null) {
    draw3D_ROBUST(str,inX,inY,z,scaleFactor);
    if (!needAdvance) {
      return 0;
    }
    GlyphVector gv=font.createGlyphVector(getFontRenderContext(),str);
    float totalAdvance=0;
    for (int i=0; i < gv.getNumGlyphs(); i++) {
      totalAdvance+=gv.getGlyphMetrics(i).getAdvance();
    }
    return totalAdvance;
  }
  upload();
  try {
    if (mPipelinedQuadRenderer == null) {
      mPipelinedQuadRenderer=new Pipelined_QuadRenderer();
    }
    TextureRenderer renderer=getBackingStore();
    float xScale=1;
    float yScale=1;
    Rect rect=glyphRectForTextureMapping;
    TextData data=(TextData)rect.getUserData();
    data.markUsed();
    Rectangle2D origRect=data.origRect();
    float x=inX - (scaleFactor * data.origOriginX());
    float y=inY - (scaleFactor * ((float)origRect.getHeight() - data.origOriginY()));
    int texturex=rect.x() + (data.origin().x - data.origOriginX());
    int texturey=renderer.getHeight() - rect.y() - (int)origRect.getHeight()- (data.origin().y - data.origOriginY());
    int width=(int)origRect.getWidth();
    int height=(int)origRect.getHeight();
    float tx1=xScale * texturex / renderer.getWidth();
    float ty1=yScale * (1.0f - (texturey / (float)renderer.getHeight()));
    float tx2=xScale * (texturex + width) / renderer.getWidth();
    float ty2=yScale * (1.0f - ((texturey + height) / (float)renderer.getHeight()));
    mPipelinedQuadRenderer.glTexCoord2f(tx1,ty1);
    mPipelinedQuadRenderer.glVertex3f(x,y,z);
    mPipelinedQuadRenderer.glTexCoord2f(tx2,ty1);
    mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor),y,z);
    mPipelinedQuadRenderer.glTexCoord2f(tx2,ty2);
    mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor),y + (height * scaleFactor),z);
    mPipelinedQuadRenderer.glTexCoord2f(tx1,ty2);
    mPipelinedQuadRenderer.glVertex3f(x,y + (height * scaleFactor),z);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return advance;
}