Program: 143628
Project: 143628
Buggy source:
@SuppressWarnings("String_Node_Str") protected static String instrumentBodyText(CharSequence bodyText,int halign,int valign,boolean isHtml,Border border,Insets margin,String cssid,char mnemonic,String imgID,String imgURL,int height,boolean isButton,Cursor bodyCursor,boolean isAnchored,boolean isElementAnchored){
  Insets padding=null;
  boolean usePadding=false;
  if (border == null) {
    padding=margin;
  }
 else   if (border instanceof EmptyBorder) {
    usePadding=true;
    padding=border.getBorderInsets(null);
  }
 else   if (border instanceof CompoundBorder) {
    Border inside=((CompoundBorder)border).getInsideBorder();
    if (inside instanceof EmptyBorder) {
      usePadding=true;
      padding=inside.getBorderInsets(null);
    }
  }
 else   if (!(border instanceof BevelBorder) && !(border instanceof EtchedBorder)) {
    if (border instanceof TitledBorder) {
      usePadding=true;
      padding=new Insets(5,7,5,7);
      int fontSize=((TitledBorder)border).getTitleFont() != null ? ((TitledBorder)border).getTitleFont().getSize() : 11;
      padding.top+=fontSize + 4;
    }
 else {
      padding=border.getBorderInsets(null);
    }
  }
  StringBuffer instrumentedBodyText=new StringBuffer();
  instrumentedBodyText.append("String_Node_Str" + (bodyCursor == null ? "String_Node_Str" : "String_Node_Str" + (bodyCursor.getType() == Cursor.HAND_CURSOR ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str") + "String_Node_Str");
  int top=0;
  int bottom=0;
  int left=0;
  int right=0;
  if (padding != null && usePadding) {
    top=padding.top;
    bottom=padding.bottom;
    left=padding.left;
    right=padding.right;
  }
  instrumentedBodyText.append("String_Node_Str" + left + "String_Node_Str");
  instrumentedBodyText.append("String_Node_Str" + right + "String_Node_Str");
  if (halign == ISupportTextSetup.LEFT)   instrumentedBodyText.append("String_Node_Str");
 else   if (halign == ISupportTextSetup.RIGHT)   instrumentedBodyText.append("String_Node_Str");
 else   instrumentedBodyText.append("String_Node_Str");
  if (cssid == null) {
    if (valign == ISupportTextSetup.TOP)     instrumentedBodyText.append("String_Node_Str" + top + "String_Node_Str");
 else     if (valign == ISupportTextSetup.BOTTOM)     instrumentedBodyText.append("String_Node_Str" + bottom + "String_Node_Str");
  }
  boolean isOnlyImgDisplay=(Strings.isEmpty(bodyText) && imgURL != null) || isHTMLWithOnlyImg(bodyText);
  if (!isHtml)   instrumentedBodyText.append("String_Node_Str");
  if (isHtml && valign != ISupportTextSetup.CENTER && cssid == null)   instrumentedBodyText.append("String_Node_Str");
 else   if ((cssid != null && !isHTMLWithOnlyImg(bodyText)) || (!isOnlyImgDisplay && valign != ISupportTextSetup.CENTER))   instrumentedBodyText.append("String_Node_Str");
 else   if (!isButton && !isHtml && imgURL == null) {
    int innerHeight=height;
    if (padding != null)     innerHeight-=padding.top + padding.bottom;
    instrumentedBodyText.append("String_Node_Str" + innerHeight + "String_Node_Str");
  }
  if (isAnchored) {
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (cssid != null) {
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(cssid);
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (!Strings.isEmpty(bodyText)) {
    CharSequence bodyTextValue=bodyText;
    if (mnemonic > 0 && !isHtml) {
      StringBuffer sbBodyText=new StringBuffer(bodyTextValue);
      int mnemonicIdx=sbBodyText.indexOf(Character.toString(mnemonic));
      if (mnemonicIdx != -1) {
        sbBodyText.insert(mnemonicIdx + 1,"String_Node_Str");
        sbBodyText.insert(mnemonicIdx,"String_Node_Str");
        bodyTextValue=sbBodyText.toString();
      }
    }
    if (imgURL != null) {
      String src="String_Node_Str";
      if (!isElementAnchored) {
        src=imgURL;
      }
      StringBuffer sb=new StringBuffer("String_Node_Str").append(imgID).append("String_Node_Str").append(src).append("String_Node_Str").append(bodyTextValue);
      bodyTextValue=sb.toString();
    }
    instrumentedBodyText.append(bodyTextValue);
  }
 else   if (imgURL != null) {
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(imgID);
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(!isElementAnchored ? imgURL : "String_Node_Str");
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (isOnlyImgDisplay) {
    String sValign=(valign == ISupportTextSetup.TOP) ? "String_Node_Str" : (valign == ISupportTextSetup.BOTTOM) ? "String_Node_Str" : "String_Node_Str";
    instrumentedBodyText=(new StringBuffer("String_Node_Str").append(sValign).append("String_Node_Str").append(instrumentedBodyText).append("String_Node_Str"));
  }
  if (border instanceof TitledBorder) {
    instrumentedBodyText=new StringBuffer(getTitledBorderOpenMarkup((TitledBorder)border) + instrumentedBodyText.toString() + getTitledBorderCloseMarkup());
  }
  return instrumentedBodyText.toString();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected static String instrumentBodyText(CharSequence bodyText,int halign,int valign,boolean isHtml,Border border,Insets margin,String cssid,char mnemonic,String imgID,String imgURL,int height,boolean isButton,Cursor bodyCursor,boolean isAnchored,boolean isElementAnchored){
  Insets padding=null;
  boolean usePadding=false;
  if (border == null) {
    padding=margin;
  }
 else   if (border instanceof EmptyBorder) {
    usePadding=true;
    padding=ComponentFactoryHelper.getBorderInsetsForNoComponent(border);
  }
 else   if (border instanceof CompoundBorder) {
    Border inside=((CompoundBorder)border).getInsideBorder();
    if (inside instanceof EmptyBorder) {
      usePadding=true;
      padding=ComponentFactoryHelper.getBorderInsetsForNoComponent(inside);
    }
  }
 else   if (!(border instanceof BevelBorder) && !(border instanceof EtchedBorder)) {
    if (border instanceof TitledBorder) {
      usePadding=true;
      padding=new Insets(5,7,5,7);
      int fontSize=((TitledBorder)border).getTitleFont() != null ? ((TitledBorder)border).getTitleFont().getSize() : 11;
      padding.top+=fontSize + 4;
    }
 else {
      padding=ComponentFactoryHelper.getBorderInsetsForNoComponent(border);
    }
  }
  StringBuffer instrumentedBodyText=new StringBuffer();
  instrumentedBodyText.append("String_Node_Str" + (bodyCursor == null ? "String_Node_Str" : "String_Node_Str" + (bodyCursor.getType() == Cursor.HAND_CURSOR ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str") + "String_Node_Str");
  int top=0;
  int bottom=0;
  int left=0;
  int right=0;
  if (padding != null && usePadding) {
    top=padding.top;
    bottom=padding.bottom;
    left=padding.left;
    right=padding.right;
  }
  instrumentedBodyText.append("String_Node_Str" + left + "String_Node_Str");
  instrumentedBodyText.append("String_Node_Str" + right + "String_Node_Str");
  if (halign == ISupportTextSetup.LEFT)   instrumentedBodyText.append("String_Node_Str");
 else   if (halign == ISupportTextSetup.RIGHT)   instrumentedBodyText.append("String_Node_Str");
 else   instrumentedBodyText.append("String_Node_Str");
  if (cssid == null) {
    if (valign == ISupportTextSetup.TOP)     instrumentedBodyText.append("String_Node_Str" + top + "String_Node_Str");
 else     if (valign == ISupportTextSetup.BOTTOM)     instrumentedBodyText.append("String_Node_Str" + bottom + "String_Node_Str");
  }
  boolean isOnlyImgDisplay=(Strings.isEmpty(bodyText) && imgURL != null) || isHTMLWithOnlyImg(bodyText);
  if (!isHtml)   instrumentedBodyText.append("String_Node_Str");
  if (isHtml && valign != ISupportTextSetup.CENTER && cssid == null)   instrumentedBodyText.append("String_Node_Str");
 else   if ((cssid != null && !isHTMLWithOnlyImg(bodyText)) || (!isOnlyImgDisplay && valign != ISupportTextSetup.CENTER))   instrumentedBodyText.append("String_Node_Str");
 else   if (!isButton && !isHtml && imgURL == null) {
    int innerHeight=height;
    if (padding != null)     innerHeight-=padding.top + padding.bottom;
    instrumentedBodyText.append("String_Node_Str" + innerHeight + "String_Node_Str");
  }
  if (isAnchored) {
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (cssid != null) {
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(cssid);
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (!Strings.isEmpty(bodyText)) {
    CharSequence bodyTextValue=bodyText;
    if (mnemonic > 0 && !isHtml) {
      StringBuffer sbBodyText=new StringBuffer(bodyTextValue);
      int mnemonicIdx=sbBodyText.indexOf(Character.toString(mnemonic));
      if (mnemonicIdx != -1) {
        sbBodyText.insert(mnemonicIdx + 1,"String_Node_Str");
        sbBodyText.insert(mnemonicIdx,"String_Node_Str");
        bodyTextValue=sbBodyText.toString();
      }
    }
    if (imgURL != null) {
      String src="String_Node_Str";
      if (!isElementAnchored) {
        src=imgURL;
      }
      StringBuffer sb=new StringBuffer("String_Node_Str").append(imgID).append("String_Node_Str").append(src).append("String_Node_Str").append(bodyTextValue);
      bodyTextValue=sb.toString();
    }
    instrumentedBodyText.append(bodyTextValue);
  }
 else   if (imgURL != null) {
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(imgID);
    instrumentedBodyText.append("String_Node_Str");
    instrumentedBodyText.append(!isElementAnchored ? imgURL : "String_Node_Str");
    instrumentedBodyText.append("String_Node_Str");
  }
  instrumentedBodyText.append("String_Node_Str");
  if (isOnlyImgDisplay) {
    String sValign=(valign == ISupportTextSetup.TOP) ? "String_Node_Str" : (valign == ISupportTextSetup.BOTTOM) ? "String_Node_Str" : "String_Node_Str";
    instrumentedBodyText=(new StringBuffer("String_Node_Str").append(sValign).append("String_Node_Str").append(instrumentedBodyText).append("String_Node_Str"));
  }
  if (border instanceof TitledBorder) {
    instrumentedBodyText=new StringBuffer(getTitledBorderOpenMarkup((TitledBorder)border) + instrumentedBodyText.toString() + getTitledBorderCloseMarkup());
  }
  return instrumentedBodyText.toString();
}