Program: 143599
Project: 143599
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;
  Insets borderMargin=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);
    }
    Border outside=((CompoundBorder)border).getOutsideBorder();
    if (outside != null) {
      borderMargin=ComponentFactoryHelper.getBorderInsetsForNoComponent(outside);
    }
  }
 else   if (!(border instanceof BevelBorder) && !(border instanceof EtchedBorder)) {
    if (border instanceof TitledBorder) {
      usePadding=true;
      padding=new Insets(5,7,5,7);
      padding.top+=ComponentFactoryHelper.getTitledBorderHeight(border);
    }
 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;
    if (borderMargin != null)     innerHeight-=borderMargin.top + borderMargin.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) {
    if (cssid == null && imgURL != null) {
      String sValign=(valign == ISupportTextSetup.TOP) ? "String_Node_Str" : (valign == ISupportTextSetup.BOTTOM) ? "String_Node_Str" : "String_Node_Str";
      String hAlign=(halign == ISupportTextSetup.LEFT) ? "String_Node_Str" : (halign == ISupportTextSetup.RIGHT) ? "String_Node_Str" : "String_Node_Str";
      String align=hAlign + "String_Node_Str" + sValign;
      instrumentedBodyText=new StringBuffer("String_Node_Str").append(imgID).append("String_Node_Str").append(align).append("String_Node_Str");
      if (!isElementAnchored) {
        instrumentedBodyText.append("String_Node_Str").append(imgURL).append("String_Node_Str");
      }
      instrumentedBodyText.append("String_Node_Str");
    }
 else {
      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;
  Insets borderMargin=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);
    }
    Border outside=((CompoundBorder)border).getOutsideBorder();
    if (outside != null) {
      borderMargin=ComponentFactoryHelper.getBorderInsetsForNoComponent(outside);
    }
  }
 else   if (!(border instanceof BevelBorder) && !(border instanceof EtchedBorder)) {
    if (border instanceof TitledBorder) {
      usePadding=true;
      padding=new Insets(5,7,5,7);
      padding.top+=ComponentFactoryHelper.getTitledBorderHeight(border);
    }
 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;
    if (borderMargin != null)     innerHeight-=borderMargin.top + borderMargin.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) {
    if (cssid == null && imgURL != null) {
      String sValign=(valign == ISupportTextSetup.TOP) ? "String_Node_Str" : (valign == ISupportTextSetup.BOTTOM) ? "String_Node_Str" : "String_Node_Str";
      String hAlign=(halign == ISupportTextSetup.LEFT) ? "String_Node_Str" : (halign == ISupportTextSetup.RIGHT) ? "String_Node_Str" : "String_Node_Str";
      String align=hAlign + "String_Node_Str" + sValign;
      String position=isButton ? "String_Node_Str" : "String_Node_Str";
      instrumentedBodyText=new StringBuffer("String_Node_Str").append(imgID).append("String_Node_Str").append(position).append("String_Node_Str").append(align).append("String_Node_Str");
      if (!isElementAnchored) {
        instrumentedBodyText.append("String_Node_Str").append(imgURL).append("String_Node_Str");
      }
      instrumentedBodyText.append("String_Node_Str");
    }
 else {
      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();
}