Program: 56961
Project: 56961
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();
  String accordionParent=panel.getAccordionParent();
  if (isCollapsible && null == accordionParent) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str" + Responsive.getResponsiveStyleClass(panel),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");
  renderPassThruAttributes(context,component,null,true);
  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) {
        writeTitleLink(panel,rw,jQueryClientID,accordionParent);
      }
      rw.writeText(_title,null);
      if (isCollapsible) {
        rw.endElement("String_Node_Str");
      }
      rw.endElement("String_Node_Str");
    }
 else {
      if (isCollapsible) {
        writeTitleLink(panel,rw,jQueryClientID,accordionParent);
      }
      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=_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");
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str","String_Node_Str","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();
  String accordionParent=panel.getAccordionParent();
  if (isCollapsible && null == accordionParent) {
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str" + Responsive.getResponsiveStyleClass(panel),null);
    rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  }
  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);
  if (!(isCollapsible && null == accordionParent)) {
    rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  }
  writeAttribute(rw,"String_Node_Str",panel.getDir(),"String_Node_Str");
  renderPassThruAttributes(context,component,null,true);
  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) {
        writeTitleLink(panel,rw,jQueryClientID,accordionParent);
      }
      rw.writeText(_title,null);
      if (isCollapsible) {
        rw.endElement("String_Node_Str");
      }
      rw.endElement("String_Node_Str");
    }
 else {
      if (isCollapsible) {
        writeTitleLink(panel,rw,jQueryClientID,accordionParent);
      }
      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=_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");
  }
  rw.startElement("String_Node_Str",panel);
  rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
}