Program: 67900
Project: 67900
Buggy source:
/** 
 * @param idr
 * @param boBlock
 * @param taBlock
 * @param la
 */
public final void renderTextInBlock(IDeviceRenderer idr,Bounds boBlock,TextAlignment taBlock,Label la) throws ChartException {
  IChartComputation cComp=((IDeviceRenderer)idr).getChartComputation();
  Text t=la.getCaption();
  String sText=t.getValue();
  ColorDefinition cdText=t.getColor();
  if (cdText == null) {
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(_sxs.getULocale()));
  }
  final GC gc=(GC)idr.getGraphicsContext();
  la.getCaption().setValue(sText);
  BoundingBox bb=cComp.computeBox(_sxs,ABOVE,la,0,0);
  if (taBlock == null) {
    taBlock=AttributeFactory.eINSTANCE.createTextAlignment();
    taBlock.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL);
    taBlock.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
  }
  HorizontalAlignment haBlock=taBlock.getHorizontalAlignment();
  VerticalAlignment vaBlock=taBlock.getVerticalAlignment();
switch (haBlock.getValue()) {
case HorizontalAlignment.CENTER:
    bb.setLeft(boBlock.getLeft() + (boBlock.getWidth() - bb.getWidth()) / 2);
  break;
case HorizontalAlignment.LEFT:
bb.setLeft(boBlock.getLeft());
break;
case HorizontalAlignment.RIGHT:
bb.setLeft(boBlock.getLeft() + boBlock.getWidth() - bb.getWidth());
break;
}
switch (vaBlock.getValue()) {
case VerticalAlignment.TOP:
bb.setTop(boBlock.getTop());
break;
case VerticalAlignment.CENTER:
bb.setTop(boBlock.getTop() + (boBlock.getHeight() - bb.getHeight()) / 2);
break;
case VerticalAlignment.BOTTOM:
bb.setTop(boBlock.getTop() + boBlock.getHeight() - bb.getHeight());
break;
}
if (ChartUtil.isShadowDefined(la)) {
final ITextMetrics itm=cComp.getTextMetrics(_sxs,la,0);
try {
final double dFH=itm.getFullHeight();
Location tmpLoc=Methods.computeRotatedTopPoint(_sxs,bb,la,dFH);
renderShadowAtLocation(idr,IConstants.ABOVE,tmpLoc,la);
}
 catch (IllegalArgumentException uiex) {
throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,uiex);
}
 finally {
cComp.recycleTextMetrics(itm);
}
}
if (la.getCaption().getFont().getRotation() == 0 || R31Enhance.isR31Available()) {
renderHorizontalText(cComp,gc,la,bb.getLeft(),bb.getTop());
}
 else {
final Image imgText=rotatedTextAsImage(cComp,la);
gc.drawImage(imgText,(int)bb.getLeft(),(int)bb.getTop());
imgText.dispose();
}
renderBorder(cComp,gc,la,IConstants.ABOVE,goFactory.createLocation(bb.getLeft() + bb.getHotPoint(),bb.getTop() + bb.getHeight()));
}

Fixed version (ground truth):
/** 
 * @param idr
 * @param boBlock
 * @param taBlock
 * @param la
 */
@Override public final void renderTextInBlock(IDeviceRenderer idr,Bounds boBlock,TextAlignment taBlock,Label la) throws ChartException {
  IChartComputation cComp=idr.getChartComputation();
  Text t=la.getCaption();
  String sText=t.getValue();
  ColorDefinition cdText=t.getColor();
  if (cdText == null) {
    throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,"String_Node_Str",Messages.getResourceBundle(_sxs.getULocale()));
  }
  final GC gc=(GC)idr.getGraphicsContext();
  la.getCaption().setValue(sText);
  BoundingBox bb=cComp.computeBox(_sxs,ABOVE,la,0,0);
  if (taBlock == null) {
    taBlock=AttributeFactory.eINSTANCE.createTextAlignment();
    taBlock.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL);
    taBlock.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
  }
  HorizontalAlignment haBlock=taBlock.getHorizontalAlignment();
  VerticalAlignment vaBlock=taBlock.getVerticalAlignment();
switch (haBlock.getValue()) {
case HorizontalAlignment.CENTER:
    bb.setLeft(boBlock.getLeft() + (boBlock.getWidth() - bb.getWidth()) / 2);
  break;
case HorizontalAlignment.LEFT:
bb.setLeft(boBlock.getLeft());
break;
case HorizontalAlignment.RIGHT:
bb.setLeft(boBlock.getLeft() + boBlock.getWidth() - bb.getWidth());
break;
}
switch (vaBlock.getValue()) {
case VerticalAlignment.TOP:
bb.setTop(boBlock.getTop());
break;
case VerticalAlignment.CENTER:
bb.setTop(boBlock.getTop() + (boBlock.getHeight() - bb.getHeight()) / 2);
break;
case VerticalAlignment.BOTTOM:
bb.setTop(boBlock.getTop() + boBlock.getHeight() - bb.getHeight());
break;
}
if (ChartUtil.isShadowDefined(la)) {
final ITextMetrics itm=cComp.getTextMetrics(_sxs,la,0);
try {
final double dFH=itm.getFullHeight();
Location tmpLoc=Methods.computeRotatedTopPoint(_sxs,bb,la,dFH);
renderShadowAtLocation(idr,IConstants.ABOVE,tmpLoc,la);
}
 catch (IllegalArgumentException uiex) {
throw new ChartException(ChartDeviceSwtActivator.ID,ChartException.RENDERING,uiex);
}
 finally {
cComp.recycleTextMetrics(itm);
}
}
if (la.getCaption().getFont().getRotation() == 0 || R31Enhance.isR31Available()) {
renderHorizontalText(cComp,gc,la,bb.getLeft(),bb.getTop());
}
 else {
final Image imgText=rotatedTextAsImage(cComp,la);
gc.drawImage(imgText,(int)bb.getLeft(),(int)bb.getTop());
imgText.dispose();
}
renderBorder(cComp,gc,la,IConstants.ABOVE,goFactory.createLocation(bb.getLeft() + bb.getHotPoint(),bb.getTop() + bb.getHeight()));
}