Program: 76330
Project: 76330
Buggy source:
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  if (peek(mergedStyle)) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  if (textValue == null || textValue == "String_Node_Str") {
    textValue="String_Node_Str";
  }
  int display;
  if (textValue != null && textValue.indexOf('\n') >= 0) {
    display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  }
 else {
    display=checkElementType(x,y,mergedStyle,styleBuffer);
  }
  String tagName;
  String url=validate(text.getHyperlinkAction());
  boolean metadataOutput=false;
  if (url != null) {
    if (enableMetadata) {
      metadataOutput=metadataEmitter.startText(text,HTMLTags.TAG_SPAN);
    }
    tagName=HTMLTags.TAG_A;
    outputAction(text.getHyperlinkAction(),url);
    setDisplayProperty(display,DISPLAY_BLOCK | DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(mergedStyle,styleBuffer);
  }
 else {
    if (enableMetadata) {
      metadataOutput=metadataEmitter.startText(text,HTMLEmitterUtil.getTagByType(display,DISPLAY_FLAG_ALL));
    }
    tagName=openTagByType(display,DISPLAY_FLAG_ALL);
    setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  setStyleName(text.getStyleClass());
  if (!metadataOutput) {
    outputBookmark(text,tagName);
  }
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  String textAlign=text.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  handleStyle(text,styleBuffer,false);
  CSSValue vAlign=mergedStyle.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  CSSValue canShrink=mergedStyle.getProperty(IStyle.STYLE_CAN_SHRINK);
  if (vAlign != null && vAlign != IStyle.BASELINE_VALUE && height != null && canShrink != IStyle.TRUE_VALUE) {
    writer.openTag(HTMLTags.TAG_TABLE);
    writer.attribute(HTMLTags.ATTR_STYLE,"String_Node_Str");
    writer.openTag(HTMLTags.TAG_TR);
    writer.openTag(HTMLTags.TAG_TD);
    StringBuffer textStyleBuffer=new StringBuffer();
    textStyleBuffer.append("String_Node_Str");
    textStyleBuffer.append(vAlign.getCssText());
    textStyleBuffer.append("String_Node_Str");
    writer.attribute(HTMLTags.ATTR_STYLE,textStyleBuffer);
    writer.text(textValue);
    writer.closeTag(HTMLTags.TAG_TD);
    writer.closeTag(HTMLTags.TAG_TR);
    writer.closeTag(HTMLTags.TAG_TABLE);
  }
 else {
    writer.text(textValue);
  }
  writer.closeTag(tagName);
  if (enableMetadata) {
    metadataEmitter.endText(text);
  }
  cellFilled=true;
}

Fixed version (ground truth):
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  if (peek(mergedStyle)) {
    return;
  }
  logger.log(Level.FINE,"String_Node_Str");
  StringBuffer styleBuffer=new StringBuffer();
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  if (textValue == null || textValue == "String_Node_Str") {
    textValue="String_Node_Str";
  }
  int display;
  if (textValue != null && textValue.indexOf('\n') >= 0) {
    display=checkElementType(x,y,width,height,mergedStyle,styleBuffer);
  }
 else {
    display=checkElementType(x,y,mergedStyle,styleBuffer);
  }
  String tagName;
  String url=validate(text.getHyperlinkAction());
  boolean metadataOutput=false;
  if (url != null) {
    if (enableMetadata) {
      metadataOutput=metadataEmitter.startText(text,HTMLTags.TAG_SPAN);
    }
    tagName=HTMLTags.TAG_A;
    outputAction(text.getHyperlinkAction(),url);
    setDisplayProperty(display,DISPLAY_BLOCK | DISPLAY_INLINE_BLOCK,styleBuffer);
    AttributeBuilder.checkHyperlinkTextDecoration(mergedStyle,styleBuffer);
  }
 else {
    if (enableMetadata) {
      metadataOutput=metadataEmitter.startText(text,HTMLEmitterUtil.getTagByType(display,DISPLAY_FLAG_ALL));
    }
    tagName=openTagByType(display,DISPLAY_FLAG_ALL);
    setDisplayProperty(display,DISPLAY_INLINE_BLOCK,styleBuffer);
  }
  setStyleName(text.getStyleClass());
  if (!metadataOutput) {
    outputBookmark(text,tagName);
  }
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  handleShrink(display,mergedStyle,height,width,styleBuffer);
  String textAlign=text.getComputedStyle().getTextAlign();
  if (textAlign != null) {
    styleBuffer.append("String_Node_Str");
    styleBuffer.append(textAlign);
    styleBuffer.append("String_Node_Str");
  }
  handleStyle(text,styleBuffer,false);
  CSSValue vAlign=mergedStyle.getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  CSSValue canShrink=mergedStyle.getProperty(IStyle.STYLE_CAN_SHRINK);
  if (vAlign != null && vAlign != IStyle.BASELINE_VALUE && height != null && canShrink != IStyle.TRUE_VALUE) {
    writer.openTag(HTMLTags.TAG_TABLE);
    StringBuffer nestingTableStyleBuffer=new StringBuffer();
    nestingTableStyleBuffer.append("String_Node_Str");
    nestingTableStyleBuffer.append(height.toString());
    writer.attribute(HTMLTags.ATTR_STYLE,nestingTableStyleBuffer);
    writer.openTag(HTMLTags.TAG_TR);
    writer.openTag(HTMLTags.TAG_TD);
    StringBuffer textStyleBuffer=new StringBuffer();
    textStyleBuffer.append("String_Node_Str");
    textStyleBuffer.append(vAlign.getCssText());
    textStyleBuffer.append("String_Node_Str");
    writer.attribute(HTMLTags.ATTR_STYLE,textStyleBuffer);
    writer.text(textValue);
    writer.closeTag(HTMLTags.TAG_TD);
    writer.closeTag(HTMLTags.TAG_TR);
    writer.closeTag(HTMLTags.TAG_TABLE);
  }
 else {
    writer.text(textValue);
  }
  writer.closeTag(tagName);
  if (enableMetadata) {
    metadataEmitter.endText(text);
  }
  cellFilled=true;
}