Program: 71236
Project: 71236
Buggy source:
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  logger.log(Level.FINE,"String_Node_Str");
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  if (textValue == null || "String_Node_Str".equals(textValue)) {
    textValue="String_Node_Str";
  }
  int display;
  if (textValue != null && textValue.indexOf('\n') >= 0) {
    display=getElementType(x,y,width,height,mergedStyle);
  }
 else {
    display=getElementType(x,y,null,null,mergedStyle);
  }
  String tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  boolean metadataOutput=false;
  if (enableMetadata) {
    metadataOutput=metadataEmitter.startText(text,tagName);
  }
  String styleClass=text.getStyleClass();
  setStyleName(styleClass,text);
  if (!metadataOutput) {
    outputBookmark(text,tagName);
  }
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildTextStyle(text,styleBuffer,display);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleVerticalAlignBegin(text);
  String url=validate(text.getHyperlinkAction());
  if (url != null) {
    outputAction(text.getHyperlinkAction(),url);
    String strColor=mergedStyle.getColor();
    if (null != strColor) {
      styleBuffer.setLength(0);
      styleBuffer.append("String_Node_Str");
      styleBuffer.append(strColor);
      styleBuffer.append("String_Node_Str");
      writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    }
    writer.text(textValue);
    writer.closeTag(HTMLTags.TAG_A);
  }
 else {
    writer.text(textValue);
  }
  htmlEmitter.handleVerticalAlignEnd(text);
  writer.closeTag(tagName);
}

Fixed version (ground truth):
public void startText(ITextContent text){
  IStyle mergedStyle=text.getStyle();
  logger.log(Level.FINE,"String_Node_Str");
  DimensionType x=text.getX();
  DimensionType y=text.getY();
  DimensionType width=text.getWidth();
  DimensionType height=text.getHeight();
  String textValue=text.getText();
  if (textValue == null || "String_Node_Str".equals(textValue)) {
    textValue="String_Node_Str";
  }
  int display=htmlEmitter.getTextElementType(x,y,width,height,mergedStyle);
  String tagName=openTagByType(display,DISPLAY_FLAG_ALL);
  boolean metadataOutput=false;
  if (enableMetadata) {
    metadataOutput=metadataEmitter.startText(text,tagName);
  }
  String styleClass=text.getStyleClass();
  setStyleName(styleClass,text);
  if (!metadataOutput) {
    outputBookmark(text,tagName);
  }
  writer.attribute(HTMLTags.ATTR_TITLE,text.getHelpText());
  StringBuffer styleBuffer=new StringBuffer();
  htmlEmitter.buildTextStyle(text,styleBuffer,display);
  writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
  htmlEmitter.handleVerticalAlignBegin(text);
  String url=validate(text.getHyperlinkAction());
  if (url != null) {
    outputAction(text.getHyperlinkAction(),url);
    String strColor=mergedStyle.getColor();
    if (null != strColor) {
      styleBuffer.setLength(0);
      styleBuffer.append("String_Node_Str");
      styleBuffer.append(strColor);
      styleBuffer.append("String_Node_Str");
      writer.attribute(HTMLTags.ATTR_STYLE,styleBuffer.toString());
    }
    writer.text(textValue);
    writer.closeTag(HTMLTags.TAG_A);
  }
 else {
    writer.text(textValue);
  }
  htmlEmitter.handleVerticalAlignEnd(text);
  writer.closeTag(tagName);
}