Program: 56958
Project: 56958
Buggy source:
private void encodeSeverityMessages(FacesContext facesContext,Messages uiMessages,String severity,List<FacesMessage> messages) throws IOException {
  ResponseWriter writer=facesContext.getResponseWriter();
  String styleClassPrefix="String_Node_Str";
  String stylePrefix="String_Node_Str";
  String iconStyleClass="String_Node_Str";
  if ("String_Node_Str".equals(severity)) {
    String warnClass=uiMessages.getWarnClass();
    if (null == warnClass)     styleClassPrefix="String_Node_Str";
 else     styleClassPrefix="String_Node_Str" + warnClass;
    iconStyleClass="String_Node_Str";
    stylePrefix=uiMessages.getWarnStyle();
  }
 else   if ("String_Node_Str".equals(severity)) {
    String fatalClass=uiMessages.getFatalClass();
    if (null == fatalClass) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + fatalClass;
    }
    stylePrefix=uiMessages.getFatalStyle();
    iconStyleClass="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(severity)) {
    String errorClass=uiMessages.getErrorClass();
    if (null == errorClass) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + errorClass;
    }
    stylePrefix=uiMessages.getErrorStyle();
    iconStyleClass="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(severity)) {
    String infoClass=uiMessages.getInfoClass();
    if (infoClass == null) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + infoClass;
    }
    stylePrefix=uiMessages.getInfoStyle();
    iconStyleClass="String_Node_Str";
  }
  if (stylePrefix == null) {
    stylePrefix="String_Node_Str";
  }
  writer.startElement("String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str" + styleClassPrefix,null);
  writer.writeAttribute("String_Node_Str","String_Node_Str" + stylePrefix,null);
  writer.startElement("String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.write("String_Node_Str");
  writer.endElement("String_Node_Str");
  boolean firstMessage=true;
  for (  FacesMessage msg : messages) {
    if (!firstMessage && uiMessages.isLineBreak())     writer.append(uiMessages.getLineBreakTag());
    firstMessage=false;
    writer.startElement("String_Node_Str",null);
    writer.writeAttribute("String_Node_Str","String_Node_Str",null);
    if (uiMessages.isShowIcon()) {
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str",iconStyleClass + "String_Node_Str");
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      writer.endElement("String_Node_Str");
    }
    if (uiMessages.isShowSummary() && msg.getSummary() != null && !msg.getSummary().trim().isEmpty() && !msg.getSummary().equals(msg.getDetail())) {
      writer.startElement("String_Node_Str",null);
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      if (uiMessages.isEscape()) {
        writer.writeText(msg.getSummary(),null);
      }
 else {
        MessageRenderer.warnOnFirstUse();
        writer.write(msg.getSummary());
      }
      writer.endElement("String_Node_Str");
      writer.endElement("String_Node_Str");
    }
    if (uiMessages.isShowDetail() && msg.getDetail() != null) {
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      if (uiMessages.isEscape()) {
        writer.writeText(msg.getDetail(),null);
      }
 else {
        MessageRenderer.warnOnFirstUse();
        writer.write(msg.getDetail());
      }
      writer.endElement("String_Node_Str");
    }
    writer.endElement("String_Node_Str");
    msg.rendered();
  }
  writer.endElement("String_Node_Str");
}

Fixed version (ground truth):
private void encodeSeverityMessages(FacesContext facesContext,Messages uiMessages,String severity,List<FacesMessage> messages) throws IOException {
  ResponseWriter writer=facesContext.getResponseWriter();
  String styleClassPrefix="String_Node_Str";
  String stylePrefix=uiMessages.getStyle();
  if (null == stylePrefix) {
    stylePrefix="String_Node_Str";
  }
 else   if (!styleClassPrefix.endsWith("String_Node_Str")) {
    stylePrefix+="String_Node_Str";
  }
  String iconStyleClass="String_Node_Str";
  if ("String_Node_Str".equals(severity)) {
    String warnClass=uiMessages.getWarnClass();
    if (null == warnClass)     styleClassPrefix="String_Node_Str";
 else     styleClassPrefix="String_Node_Str" + warnClass;
    iconStyleClass="String_Node_Str";
    stylePrefix+=uiMessages.getWarnStyle();
  }
 else   if ("String_Node_Str".equals(severity)) {
    String fatalClass=uiMessages.getFatalClass();
    if (null == fatalClass) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + fatalClass;
    }
    stylePrefix+=uiMessages.getFatalStyle();
    iconStyleClass="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(severity)) {
    String errorClass=uiMessages.getErrorClass();
    if (null == errorClass) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + errorClass;
    }
    stylePrefix+=uiMessages.getErrorStyle();
    iconStyleClass="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(severity)) {
    String infoClass=uiMessages.getInfoClass();
    if (infoClass == null) {
      styleClassPrefix="String_Node_Str";
    }
 else {
      styleClassPrefix="String_Node_Str" + infoClass;
    }
    stylePrefix+=uiMessages.getInfoStyle();
    iconStyleClass="String_Node_Str";
  }
  writer.startElement("String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str" + styleClassPrefix,null);
  writer.writeAttribute("String_Node_Str","String_Node_Str" + stylePrefix,null);
  writer.startElement("String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.writeAttribute("String_Node_Str","String_Node_Str",null);
  writer.write("String_Node_Str");
  writer.endElement("String_Node_Str");
  boolean firstMessage=true;
  for (  FacesMessage msg : messages) {
    if (!firstMessage && uiMessages.isLineBreak())     writer.append(uiMessages.getLineBreakTag());
    firstMessage=false;
    writer.startElement("String_Node_Str",null);
    writer.writeAttribute("String_Node_Str","String_Node_Str",null);
    if (uiMessages.isShowIcon()) {
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str",iconStyleClass + "String_Node_Str");
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      writer.endElement("String_Node_Str");
    }
    if (uiMessages.isShowSummary() && msg.getSummary() != null && !msg.getSummary().trim().isEmpty() && !msg.getSummary().equals(msg.getDetail())) {
      writer.startElement("String_Node_Str",null);
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      if (uiMessages.isEscape()) {
        writer.writeText(msg.getSummary(),null);
      }
 else {
        MessageRenderer.warnOnFirstUse();
        writer.write(msg.getSummary());
      }
      writer.endElement("String_Node_Str");
      writer.endElement("String_Node_Str");
    }
    if (uiMessages.isShowDetail() && msg.getDetail() != null) {
      writer.startElement("String_Node_Str",null);
      writeAttribute(writer,"String_Node_Str","String_Node_Str");
      if (uiMessages.isEscape()) {
        writer.writeText(msg.getDetail(),null);
      }
 else {
        MessageRenderer.warnOnFirstUse();
        writer.write(msg.getDetail());
      }
      writer.endElement("String_Node_Str");
    }
    writer.endElement("String_Node_Str");
    msg.rendered();
  }
  writer.endElement("String_Node_Str");
}