Program: 57052
Project: 57052
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 encodeEnd(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Panel panel=(Panel)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=panel.getClientId();
  rw.endElement(H.DIV);
  UIComponent foot=panel.getFacet("String_Node_Str");
  if (foot != null) {
    rw.startElement(H.DIV,panel);
    rw.writeAttribute(H.CLASS,"String_Node_Str",H.CLASS);
    foot.encodeAll(context);
    rw.endElement(H.DIV);
  }
  rw.endElement(H.DIV);
  boolean isCollapsible=panel.isCollapsible();
  if (isCollapsible) {
    String jQueryClientID=clientId.replace("String_Node_Str","String_Node_Str");
    rw.endElement(H.DIV);
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str",null);
    String hiddenInputFieldID=jQueryClientID + "String_Node_Str";
    rw.writeAttribute("String_Node_Str",hiddenInputFieldID,"String_Node_Str");
    rw.writeAttribute("String_Node_Str",hiddenInputFieldID,"String_Node_Str");
    rw.writeAttribute("String_Node_Str",panel.isCollapsed(),"String_Node_Str");
    rw.endElement("String_Node_Str");
    rw.startElement("String_Node_Str",panel);
    rw.writeText("String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + jQueryClientID + "String_Node_Str"+ "String_Node_Str"+ hiddenInputFieldID+ "String_Node_Str",null);
    rw.writeText("String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + jQueryClientID + "String_Node_Str"+ "String_Node_Str"+ hiddenInputFieldID+ "String_Node_Str",null);
    rw.writeText("String_Node_Str",null);
    rw.endElement("String_Node_Str");
  }
  Tooltip.activateTooltips(context,panel.getAttributes(),panel);
}

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 encodeEnd(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Panel panel=(Panel)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=panel.getClientId();
  rw.endElement(H.DIV);
  UIComponent foot=panel.getFacet("String_Node_Str");
  if (foot != null) {
    rw.startElement(H.DIV,panel);
    rw.writeAttribute(H.CLASS,"String_Node_Str",H.CLASS);
    foot.encodeAll(context);
    rw.endElement(H.DIV);
  }
  rw.endElement(H.DIV);
  boolean isCollapsible=panel.isCollapsible();
  if (isCollapsible) {
    String jQueryClientID=clientId.replace("String_Node_Str","String_Node_Str");
    rw.endElement(H.DIV);
    rw.startElement("String_Node_Str",panel);
    rw.writeAttribute("String_Node_Str","String_Node_Str",null);
    String hiddenInputFieldID=jQueryClientID + "String_Node_Str";
    rw.writeAttribute("String_Node_Str",hiddenInputFieldID,"String_Node_Str");
    rw.writeAttribute("String_Node_Str",hiddenInputFieldID,"String_Node_Str");
    rw.writeAttribute("String_Node_Str",String.valueOf(panel.isCollapsed()),"String_Node_Str");
    rw.endElement("String_Node_Str");
    rw.startElement("String_Node_Str",panel);
    rw.writeText("String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + jQueryClientID + "String_Node_Str"+ "String_Node_Str"+ hiddenInputFieldID+ "String_Node_Str",null);
    rw.writeText("String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + jQueryClientID + "String_Node_Str"+ "String_Node_Str"+ hiddenInputFieldID+ "String_Node_Str",null);
    rw.writeText("String_Node_Str",null);
    rw.endElement("String_Node_Str");
  }
  Tooltip.activateTooltips(context,panel.getAttributes(),panel);
}