Program: 78010
Project: 78010
Buggy source:
/** 
 * @param g2d
 * @param f
 * @param dX
 * @param dY
 * @param sText
 * @param iAngleInDegrees
 */
private final void showBottomValue(IPrimitiveRenderer ipr,Location lo,Label la,boolean bShadow){
  Graphics2D g2d=(Graphics2D)((IDeviceRenderer)ipr).getGraphicsContext();
  double dX=lo.getX(), dY=lo.getY();
  FontDefinition fd=la.getCaption().getFont();
  double dAngleInDegrees=fd.getRotation();
  Color clrText=(Color)_sxs.getColor(la.getCaption().getColor());
  Color clrBackground=null;
  if (la.getBackground() != null) {
    clrBackground=(Color)_sxs.getColor((ColorDefinition)la.getBackground());
  }
  double dAngleInRadians=((-dAngleInDegrees * Math.PI) / 180.0);
  final ITextMetrics itm=new SVGTextMetrics(_sxs,la);
  final double dFW=itm.getFullWidth();
  final double dH=itm.getHeight();
  final double dD=itm.getDescent();
  final double dFH=itm.getFullHeight();
  double dXOffset=0, dW=0;
  final int iLC=itm.getLineCount();
  final Insets ins=la.getInsets().scaledInstance(_sxs.getDpiResolution() / 72d);
  SVGTextLayout tl;
  final HorizontalAlignment ha=la.getCaption().getFont().getAlignment().getHorizontalAlignment();
  final boolean bRightAligned=ha.getValue() == HorizontalAlignment.RIGHT;
  final boolean bCenterAligned=ha.getValue() == HorizontalAlignment.CENTER;
  dX-=dFW / 2;
  dY+=dH;
  if (dAngleInDegrees == 0) {
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH));
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
  }
 else   if (dAngleInDegrees > 0 && dAngleInDegrees < 90) {
    double dSineTheta=Math.abs(Math.sin(dAngleInRadians));
    double dCosTheta=Math.abs(Math.cos(dAngleInRadians));
    double dDeltaX=dFW * dCosTheta - dH * dSineTheta - dFW / 2.0;
    double dDeltaY=dH * dCosTheta + dFW * dSineTheta - dH;
    dX-=dDeltaX;
    dY+=dDeltaY;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH));
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
 else   if (dAngleInDegrees < 0 && dAngleInDegrees > -90) {
    dX+=dFW / 2;
    g2d.rotate(dAngleInRadians,dX,dY - dH);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH));
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY - dH);
  }
 else   if (dAngleInDegrees == 90) {
    double dYHalfOffset=(dFH + dH) / 2.0;
    double dDeltaX=(dFW + dH) / 2;
    double dDeltaY=(dFW - dH);
    dX+=dDeltaX;
    dY+=dDeltaY;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dYHalfOffset) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dYHalfOffset) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dYHalfOffset) + 3,dFW,dFH));
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dYHalfOffset,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(((dY - dD) - ((iLC - i) * dH - (iLC + 1) * dH / 2)) + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
 else   if (dAngleInDegrees == -90) {
    dX+=dFW / 2;
    dY-=dH;
    double dYHalfOffset=(dFH + dH) / 2d;
    double dDeltaX=dYHalfOffset - dFH / 2d;
    dX-=dDeltaX;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dYHalfOffset) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dYHalfOffset) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dYHalfOffset) + 3,dFW,dFH));
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dYHalfOffset,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)((dY - dD) - dYHalfOffset + dH * (i + 1) + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
  itm.dispose();
}

Fixed version (ground truth):
/** 
 * @param g2d
 * @param f
 * @param dX
 * @param dY
 * @param sText
 * @param iAngleInDegrees
 */
private final void showBottomValue(IPrimitiveRenderer ipr,Location lo,Label la,boolean bShadow){
  SVGGraphics2D g2d=(SVGGraphics2D)((IDeviceRenderer)ipr).getGraphicsContext();
  double dX=lo.getX(), dY=lo.getY();
  FontDefinition fd=la.getCaption().getFont();
  double dAngleInDegrees=fd.getRotation();
  Color clrText=(Color)_sxs.getColor(la.getCaption().getColor());
  Color clrBackground=null;
  if (la.getBackground() != null) {
    clrBackground=(Color)_sxs.getColor((ColorDefinition)la.getBackground());
  }
  double dAngleInRadians=((-dAngleInDegrees * Math.PI) / 180.0);
  final ITextMetrics itm=new SVGTextMetrics(_sxs,la);
  final double dFW=itm.getFullWidth();
  final double dH=itm.getHeight();
  final double dD=itm.getDescent();
  final double dFH=itm.getFullHeight();
  double dXOffset=0, dW=0;
  final int iLC=itm.getLineCount();
  final Insets ins=la.getInsets().scaledInstance(_sxs.getDpiResolution() / 72d);
  SVGTextLayout tl;
  final HorizontalAlignment ha=la.getCaption().getFont().getAlignment().getHorizontalAlignment();
  final boolean bRightAligned=ha.getValue() == HorizontalAlignment.RIGHT;
  final boolean bCenterAligned=ha.getValue() == HorizontalAlignment.CENTER;
  dX-=dFW / 2;
  dY+=dH;
  if (dAngleInDegrees == 0) {
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH),false);
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
  }
 else   if (dAngleInDegrees > 0 && dAngleInDegrees < 90) {
    double dSineTheta=Math.abs(Math.sin(dAngleInRadians));
    double dCosTheta=Math.abs(Math.cos(dAngleInRadians));
    double dDeltaX=dFW * dCosTheta - dH * dSineTheta - dFW / 2.0;
    double dDeltaY=dH * dCosTheta + dFW * dSineTheta - dH;
    dX-=dDeltaX;
    dY+=dDeltaY;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH),false);
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
 else   if (dAngleInDegrees < 0 && dAngleInDegrees > -90) {
    dX+=dFW / 2;
    g2d.rotate(dAngleInRadians,dX,dY - dH);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dH) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dH) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dH) + 3,dFW,dFH),false);
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dH,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(dY - dD + dH * i + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY - dH);
  }
 else   if (dAngleInDegrees == 90) {
    double dYHalfOffset=(dFH + dH) / 2.0;
    double dDeltaX=(dFW + dH) / 2;
    double dDeltaY=(dFW - dH);
    dX+=dDeltaX;
    dY+=dDeltaY;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dYHalfOffset) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dYHalfOffset) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dYHalfOffset) + 3,dFW,dFH),false);
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dYHalfOffset,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)(((dY - dD) - ((iLC - i) * dH - (iLC + 1) * dH / 2)) + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
 else   if (dAngleInDegrees == -90) {
    dX+=dFW / 2;
    dY-=dH;
    double dYHalfOffset=(dFH + dH) / 2d;
    double dDeltaX=dYHalfOffset - dFH / 2d;
    dX-=dDeltaX;
    g2d.rotate(dAngleInRadians,dX,dY);
    if (bShadow) {
      g2d.setPaint(new GradientPaint(new Point2D.Double(dX + 3,(dY - dYHalfOffset) + 3),(Color)_sxs.getColor(la.getShadowColor()),new Point2D.Double(dX + 3 + dFW,(dY - dYHalfOffset) + 3 + dFH),(Color)_sxs.getColor(la.getShadowColor().translucent())));
      g2d.fill(new Rectangle2D.Double(dX + 3,(dY - dYHalfOffset) + 3,dFW,dFH),false);
    }
 else {
      final Rectangle2D.Double r2d=new Rectangle2D.Double(dX,dY - dYHalfOffset,dFW,dFH);
      if (clrBackground != null) {
        g2d.setColor(clrBackground);
        g2d.fill(r2d);
      }
      g2d.setColor(clrText);
      for (int i=0; i < iLC; i++) {
        tl=((SVGTextMetrics)itm).getLayout(i);
        if (bRightAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + dFW - dW - ins.getRight();
        }
 else         if (bCenterAligned) {
          dW=tl.getBounds().getWidth();
          dXOffset=-ins.getLeft() + (dFW - dW) / 2;
        }
        tl.draw(g2d,(float)(dX + dXOffset + ins.getLeft()),(float)((dY - dD) - dYHalfOffset + dH * (i + 1) + ins.getTop()));
      }
      renderOutline(ipr,la.getOutline(),r2d);
    }
    g2d.rotate(-dAngleInRadians,dX,dY);
  }
  itm.dispose();
}