Program: 143625
Project: 143625
Buggy source:
/** 
 * @param height
 * @param border
 * @param margin
 * @param fontSize
 * @param properties
 * @return
 */
@SuppressWarnings("String_Node_Str") public Insets getPaddingAndBorder(int height,Border border,Insets margin,int fontSize,Properties properties,boolean isButton,int valign){
  Insets insets=null;
  Insets borderMargin=margin;
  if (border != null) {
    if (border instanceof CompoundBorder) {
      Insets marginInside=((CompoundBorder)border).getInsideBorder().getBorderInsets(null);
      borderMargin=TemplateGenerator.sumInsets(borderMargin,marginInside);
      Border ob=((CompoundBorder)border).getOutsideBorder();
      if (ob instanceof ISupportCustomBorderInsets) {
        insets=((ISupportCustomBorderInsets)ob).getCustomBorderInsets();
      }
 else {
        insets=ob.getBorderInsets(null);
      }
    }
 else     if (border instanceof ISupportCustomBorderInsets) {
      insets=((ISupportCustomBorderInsets)border).getCustomBorderInsets();
    }
 else {
      try {
        insets=border.getBorderInsets(null);
      }
 catch (      Exception ex) {
        insets=defaultBorder;
        Debug.error(ex);
      }
    }
  }
 else {
    insets=defaultBorder;
  }
  Insets padding=borderMargin;
  if (padding == null)   padding=defaultPadding;
  if (properties != null) {
    Insets borderAndPadding=TemplateGenerator.sumInsets(insets,padding);
    int innerHeight=height;
    if (borderAndPadding != null)     innerHeight-=borderAndPadding.top + borderAndPadding.bottom;
    int bottomPaddingExtra=0;
    if (isButton && valign != ISupportTextSetup.CENTER) {
      bottomPaddingExtra=innerHeight;
    }
    if (padding == null) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",getSizeString(bottomPaddingExtra));
    }
 else {
      properties.put("String_Node_Str",getSizeString(padding.top));
      properties.put("String_Node_Str",getSizeString(padding.right));
      properties.put("String_Node_Str",getSizeString(padding.left));
      properties.put("String_Node_Str",getSizeString((bottomPaddingExtra + padding.bottom)));
    }
  }
  if (insets == null)   insets=padding;
 else {
    insets=TemplateGenerator.sumInsets(insets,padding);
  }
  return insets;
}

Fixed version (ground truth):
/** 
 * @param height
 * @param border
 * @param margin
 * @param fontSize
 * @param properties
 * @return
 */
@SuppressWarnings("String_Node_Str") public Insets getPaddingAndBorder(int height,Border border,Insets margin,int fontSize,Properties properties,boolean isButton,int valign){
  Insets insets=null;
  Insets borderMargin=margin;
  if (border != null) {
    if (border instanceof CompoundBorder) {
      Insets marginInside=ComponentFactoryHelper.getBorderInsetsForNoComponent(((CompoundBorder)border).getInsideBorder());
      borderMargin=TemplateGenerator.sumInsets(borderMargin,marginInside);
      Border ob=((CompoundBorder)border).getOutsideBorder();
      if (ob instanceof ISupportCustomBorderInsets) {
        insets=((ISupportCustomBorderInsets)ob).getCustomBorderInsets();
      }
 else {
        insets=ComponentFactoryHelper.getBorderInsetsForNoComponent(ob);
      }
    }
 else     if (border instanceof ISupportCustomBorderInsets) {
      insets=((ISupportCustomBorderInsets)border).getCustomBorderInsets();
    }
 else {
      try {
        insets=ComponentFactoryHelper.getBorderInsetsForNoComponent(border);
      }
 catch (      Exception ex) {
        insets=defaultBorder;
        Debug.error(ex);
      }
    }
  }
 else {
    insets=defaultBorder;
  }
  Insets padding=borderMargin;
  if (padding == null)   padding=defaultPadding;
  if (properties != null) {
    Insets borderAndPadding=TemplateGenerator.sumInsets(insets,padding);
    int innerHeight=height;
    if (borderAndPadding != null)     innerHeight-=borderAndPadding.top + borderAndPadding.bottom;
    int bottomPaddingExtra=0;
    if (isButton && valign != ISupportTextSetup.CENTER) {
      bottomPaddingExtra=innerHeight;
    }
    if (padding == null) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",getSizeString(bottomPaddingExtra));
    }
 else {
      properties.put("String_Node_Str",getSizeString(padding.top));
      properties.put("String_Node_Str",getSizeString(padding.right));
      properties.put("String_Node_Str",getSizeString(padding.left));
      properties.put("String_Node_Str",getSizeString((bottomPaddingExtra + padding.bottom)));
    }
  }
  if (insets == null)   insets=padding;
 else {
    insets=TemplateGenerator.sumInsets(insets,padding);
  }
  return insets;
}