Program: 57039
Project: 57039
Buggy source:
/** 
 * This methods generates the HTML code of the current b:panel. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML code between the beginning and the end of the component. For instance, in the case of a panel component the content of the panel is generated by <code>encodeChildren()</code>. After that, <code>encodeEnd()</code> is called to generate the rest of the HTML code.
 * @param context the FacesContext.
 * @param component the current b:panel.
 * @throws IOException thrown if something goes wrong when writing the HTML code.
 */
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Panel panel=(Panel)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=panel.getClientId();
  String jQueryClientID=clientId.replace("String_Node_Str","String_Node_Str");
  boolean isCollapsible=panel.isCollapsible();
  if (isCollapsible) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str",null);
  }
  String _look=panel.getLook();
  String _title=panel.getTitle();
  String _titleClass=panel.getTitleClass();
  String _styleClass=panel.getStyleClass();
  if (null == _styleClass) {
    _styleClass="String_Node_Str";
  }
 else {
    _styleClass+="String_Node_Str";
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",panel.getDir(),"String_Node_Str");
  AJAXRenderer.generateBootsFacesAJAXAndJavaScript(context,panel,rw);
  Tooltip.generateTooltip(context,panel,rw);
  String _style=panel.getStyle();
  if (null != _style && _style.length() > 0) {
    rw.writeAttribute("String_Node_Str",_style,"String_Node_Str");
  }
  if (_look != null) {
    rw.writeAttribute("String_Node_Str",_styleClass + "String_Node_Str" + _look,"String_Node_Str");
  }
 else {
    rw.writeAttribute("String_Node_Str",_styleClass + "String_Node_Str","String_Node_Str");
  }
  UIComponent head=panel.getFacet("String_Node_Str");
  if (head != null || _title != null) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
    String _titleStyle=panel.getTitleStyle();
    if (null != _titleStyle) {
      rw.writeAttribute("String_Node_Str",_titleStyle,"String_Node_Str");
    }
    if (_title != null) {
      rw.startElement("String_Node_Str",panel);
      if (_titleClass != null) {
        rw.writeAttribute("String_Node_Str",_titleClass,"String_Node_Str");
      }
 else {
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
      }
      if (isCollapsible) {
        rw.startElement("String_Node_Str",panel);
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
        rw.writeAttribute("String_Node_Str","String_Node_Str" + jQueryClientID + "String_Node_Str","String_Node_Str");
        if (panel.isCollapsed()) {
          rw.writeAttribute("String_Node_Str","String_Node_Str",null);
        }
      }
      rw.writeText(_title,null);
      rw.endElement("String_Node_Str");
      rw.endElement("String_Node_Str");
    }
 else {
      if (isCollapsible) {
        rw.startElement("String_Node_Str",panel);
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
        rw.writeAttribute("String_Node_Str","String_Node_Str" + jQueryClientID + "String_Node_Str","String_Node_Str");
        if (panel.isCollapsed()) {
          rw.writeAttribute("String_Node_Str","String_Node_Str",null);
        }
      }
      head.encodeAll(context);
      if (isCollapsible) {
        rw.endElement("String_Node_Str");
      }
    }
    rw.endElement("String_Node_Str");
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str",jQueryClientID + "String_Node_Str",null);
  writeAttribute(rw,"String_Node_Str",panel.getDir(),"String_Node_Str");
  String _contentClass=panel.getContentClass();
  if (null == _contentClass)   _contentClass="String_Node_Str";
  if (isCollapsible) {
    _contentClass+="String_Node_Str";
    if (!panel.isCollapsed())     _contentClass+="String_Node_Str";
  }
  _contentClass="String_Node_Str" + "String_Node_Str" + _contentClass;
  _contentClass=_contentClass.trim();
  if (_contentClass.length() > 0)   rw.writeAttribute("String_Node_Str",_contentClass,"String_Node_Str");
  String _contentStyle=panel.getContentStyle();
  if (null != _contentStyle && _contentStyle.length() > 0) {
    rw.writeAttribute("String_Node_Str",_contentStyle,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * This methods generates the HTML code of the current b:panel. <code>encodeBegin</code> generates the start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML code between the beginning and the end of the component. For instance, in the case of a panel component the content of the panel is generated by <code>encodeChildren()</code>. After that, <code>encodeEnd()</code> is called to generate the rest of the HTML code.
 * @param context the FacesContext.
 * @param component the current b:panel.
 * @throws IOException thrown if something goes wrong when writing the HTML code.
 */
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Panel panel=(Panel)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=panel.getClientId();
  String jQueryClientID=clientId.replace("String_Node_Str","String_Node_Str");
  boolean isCollapsible=panel.isCollapsible();
  if (isCollapsible) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str",null);
  }
  String _look=panel.getLook();
  String _title=panel.getTitle();
  String _titleClass=panel.getTitleClass();
  String _styleClass=panel.getStyleClass();
  if (null == _styleClass) {
    _styleClass="String_Node_Str";
  }
 else {
    _styleClass+="String_Node_Str";
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",panel.getDir(),"String_Node_Str");
  AJAXRenderer.generateBootsFacesAJAXAndJavaScript(context,panel,rw);
  Tooltip.generateTooltip(context,panel,rw);
  String _style=panel.getStyle();
  if (null != _style && _style.length() > 0) {
    rw.writeAttribute("String_Node_Str",_style,"String_Node_Str");
  }
  if (_look != null) {
    rw.writeAttribute("String_Node_Str",_styleClass + "String_Node_Str" + _look,"String_Node_Str");
  }
 else {
    rw.writeAttribute("String_Node_Str",_styleClass + "String_Node_Str","String_Node_Str");
  }
  UIComponent head=panel.getFacet("String_Node_Str");
  if (head != null || _title != null) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
    String _titleStyle=panel.getTitleStyle();
    if (null != _titleStyle) {
      rw.writeAttribute("String_Node_Str",_titleStyle,"String_Node_Str");
    }
    if (_title != null) {
      rw.startElement("String_Node_Str",panel);
      if (_titleClass != null) {
        rw.writeAttribute("String_Node_Str",_titleClass,"String_Node_Str");
      }
 else {
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
      }
      if (isCollapsible) {
        rw.startElement("String_Node_Str",panel);
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
        rw.writeAttribute("String_Node_Str","String_Node_Str" + jQueryClientID + "String_Node_Str","String_Node_Str");
        if (panel.isCollapsed()) {
          rw.writeAttribute("String_Node_Str","String_Node_Str",null);
        }
      }
      rw.writeText(_title,null);
      if (isCollapsible) {
        rw.endElement("String_Node_Str");
      }
      rw.endElement("String_Node_Str");
    }
 else {
      if (isCollapsible) {
        rw.startElement("String_Node_Str",panel);
        rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
        rw.writeAttribute("String_Node_Str","String_Node_Str" + jQueryClientID + "String_Node_Str","String_Node_Str");
        if (panel.isCollapsed()) {
          rw.writeAttribute("String_Node_Str","String_Node_Str",null);
        }
      }
      head.encodeAll(context);
      if (isCollapsible) {
        rw.endElement("String_Node_Str");
      }
    }
    rw.endElement("String_Node_Str");
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str",jQueryClientID + "String_Node_Str",null);
  writeAttribute(rw,"String_Node_Str",panel.getDir(),"String_Node_Str");
  String _contentClass=panel.getContentClass();
  if (null == _contentClass)   _contentClass="String_Node_Str";
  if (isCollapsible) {
    _contentClass+="String_Node_Str";
    if (!panel.isCollapsed())     _contentClass+="String_Node_Str";
  }
  _contentClass="String_Node_Str" + "String_Node_Str" + _contentClass;
  _contentClass=_contentClass.trim();
  if (_contentClass.length() > 0)   rw.writeAttribute("String_Node_Str",_contentClass,"String_Node_Str");
  String _contentStyle=panel.getContentStyle();
  if (null != _contentStyle && _contentStyle.length() > 0) {
    rw.writeAttribute("String_Node_Str",_contentStyle,"String_Node_Str");
  }
}