Program: 79208
Project: 79208
Buggy source:
/** 
 * Transform other units to pixel.
 * @param object model to keep the measure and units.
 * @param fontSize the parent font size.
 * @return The pixel value.
 */
public static double convertToPixel(Object object,int fontSize){
  double px=0;
  double measure=0;
  String units="String_Node_Str";
  if (object instanceof DimensionValue) {
    DimensionValue dimension=(DimensionValue)object;
    measure=dimension.getMeasure();
    units=dimension.getUnits();
  }
 else   if (object instanceof DimensionHandle) {
    DimensionHandle dimension=(DimensionHandle)object;
    measure=dimension.getMeasure();
    units=dimension.getUnits();
  }
  if (DesignChoiceConstants.UNITS_PX.equals(units)) {
    return measure;
  }
  if ("String_Node_Str".equalsIgnoreCase(units)) {
    px=measure;
  }
  if (fontSize == 0) {
    Font defaultFont=JFaceResources.getDefaultFont();
    FontData[] fontData=defaultFont.getFontData();
    fontSize=fontData[0].height;
  }
  if (DesignChoiceConstants.UNITS_EM.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if (DesignChoiceConstants.UNITS_EX.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize / 3,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize / 100,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if ("String_Node_Str".equals(units)) {
    units=SessionHandleAdapter.getInstance().getReportDesignHandle().getDefaultUnits();
    px=DimensionUtil.convertTo(measure,units,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else {
    px=DimensionUtil.convertTo(measure,units,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
  return MetricUtility.inchToPixel(px);
}

Fixed version (ground truth):
/** 
 * Transform other units to pixel.
 * @param object model to keep the measure and units.
 * @param fontSize the parent font size.
 * @return The pixel value.
 */
public static double convertToPixel(Object object,int fontSize){
  double px=0;
  double measure=0;
  String units="String_Node_Str";
  if (object instanceof DimensionValue) {
    DimensionValue dimension=(DimensionValue)object;
    measure=dimension.getMeasure();
    units=dimension.getUnits();
  }
 else   if (object instanceof DimensionHandle) {
    DimensionHandle dimension=(DimensionHandle)object;
    measure=dimension.getMeasure();
    units=dimension.getUnits();
  }
  if (DesignChoiceConstants.UNITS_PX.equals(units)) {
    return measure;
  }
  if ("String_Node_Str".equalsIgnoreCase(units)) {
    px=measure;
  }
  if (fontSize == 0) {
    Font defaultFont=JFaceResources.getDefaultFont();
    FontData[] fontData=defaultFont.getFontData();
    fontSize=fontData[0].height;
  }
  if (DesignChoiceConstants.UNITS_EM.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if (DesignChoiceConstants.UNITS_EX.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize / 3,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(units)) {
    px=DimensionUtil.convertTo(measure * fontSize / 100,DesignChoiceConstants.UNITS_PT,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else   if ("String_Node_Str".equals(units) || units == null) {
    units=SessionHandleAdapter.getInstance().getReportDesignHandle().getDefaultUnits();
    px=DimensionUtil.convertTo(measure,units,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
 else {
    px=DimensionUtil.convertTo(measure,units,DesignChoiceConstants.UNITS_IN).getMeasure();
  }
  return MetricUtility.inchToPixel(px);
}