Program: 56964
Project: 56964
Buggy source:
/** 
 * This methods generates the HTML code of the current b:dataTable. <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:dataTable.
 * @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;
  }
  DataTable dataTable=(DataTable)component;
  Map<Integer,String> columnSortOrder=dataTable.getColumnSortOrderMap();
  int pageLength=dataTable.getPageLength();
  String orderString="String_Node_Str";
  if (columnSortOrder != null) {
    StringBuilder sb=new StringBuilder();
    int i=0;
    for (    Map.Entry<Integer,String> entry : columnSortOrder.entrySet()) {
      String separator=(i > 0) ? "String_Node_Str" : "String_Node_Str";
      sb.append(separator).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append("String_Node_Str");
      i++;
    }
    orderString=sb.toString();
  }
  ResponseWriter rw=context.getResponseWriter();
  String clientIdRaw=dataTable.getClientId();
  String clientId=clientIdRaw.replace("String_Node_Str","String_Node_Str");
  String widgetVar=dataTable.getWidgetVar();
  if (null == widgetVar) {
    widgetVar=clientId + "String_Node_Str";
  }
  String lang=determineLanguage(context,dataTable);
  rw.endElement("String_Node_Str");
  String responsiveStyle=Responsive.getResponsiveStyleClass(dataTable,false);
  if (null != responsiveStyle && responsiveStyle.trim().length() > 0) {
    rw.endElement("String_Node_Str");
  }
  Tooltip.activateTooltips(context,dataTable);
  rw.startElement("String_Node_Str",component);
  rw.writeText("String_Node_Str",null);
  rw.writeText(widgetVar + "String_Node_Str" + clientId+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ clientIdRaw.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ widgetVar+ "String_Node_Str"+ "String_Node_Str"+ widgetVar+ "String_Node_Str"+ "String_Node_Str"+ dataTable.isFixedHeader()+ "String_Node_Str"+ "String_Node_Str"+ dataTable.isResponsive()+ "String_Node_Str"+ "String_Node_Str"+ dataTable.isPaginated()+ "String_Node_Str"+ "String_Node_Str"+ pageLength+ "String_Node_Str"+ "String_Node_Str"+ getPageLengthMenu(dataTable)+ "String_Node_Str"+ "String_Node_Str"+ dataTable.isSearching()+ "String_Node_Str"+ "String_Node_Str"+ orderString+ "String_Node_Str"+ "String_Node_Str"+ dataTable.isSaveState()+ "String_Node_Str"+ "String_Node_Str"+ generateScrollOptions(dataTable)+ (BsfUtils.isStringValued(lang) ? "String_Node_Str" + lang + "String_Node_Str" : "String_Node_Str")+ generateColumnInfos(dataTable.getColumnInfo())+ "String_Node_Str",null);
  if (dataTable.isMultiColumnSearch()) {
    rw.writeText("String_Node_Str" + widgetVar + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + widgetVar + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  }
  rw.writeText("String_Node_Str",null);
  rw.endElement("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This methods generates the HTML code of the current b:dataTable. <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:dataTable.
 * @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;
  }
  DataTable dataTable=(DataTable)component;
  Map<Integer,String> columnSortOrder=dataTable.getColumnSortOrderMap();
  int pageLength=dataTable.getPageLength();
  String orderString="String_Node_Str";
  if (columnSortOrder != null) {
    StringBuilder sb=new StringBuilder();
    int i=0;
    for (    Map.Entry<Integer,String> entry : columnSortOrder.entrySet()) {
      String separator=(i > 0) ? "String_Node_Str" : "String_Node_Str";
      sb.append(separator).append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append("String_Node_Str").append(entry.getValue()).append("String_Node_Str").append("String_Node_Str");
      i++;
    }
    orderString=sb.toString();
  }
  ResponseWriter rw=context.getResponseWriter();
  String clientIdRaw=dataTable.getClientId();
  String clientId=clientIdRaw.replace("String_Node_Str","String_Node_Str");
  String widgetVar=dataTable.getWidgetVar();
  if (null == widgetVar) {
    widgetVar=clientId + "String_Node_Str";
  }
  String lang=determineLanguage(context,dataTable);
  rw.endElement("String_Node_Str");
  String responsiveStyle=Responsive.getResponsiveStyleClass(dataTable,false);
  if (null != responsiveStyle && responsiveStyle.trim().length() > 0) {
    rw.endElement("String_Node_Str");
  }
  Tooltip.activateTooltips(context,dataTable);
  rw.startElement("String_Node_Str",component);
  rw.writeText("String_Node_Str",null);
  String options="String_Node_Str";
  options=addOptions("String_Node_Str" + dataTable.isFixedHeader(),options);
  options=addOptions("String_Node_Str" + dataTable.isResponsive(),options);
  options=addOptions("String_Node_Str" + dataTable.isPaginated(),options);
  options=addOptions("String_Node_Str" + pageLength,options);
  options=addOptions("String_Node_Str" + getPageLengthMenu(dataTable),options);
  options=addOptions("String_Node_Str" + dataTable.isSearching(),options);
  options=addOptions("String_Node_Str" + orderString,options);
  options=addOptions("String_Node_Str" + dataTable.isSaveState(),options);
  options=addOptions("String_Node_Str",options);
  options=addOptions(generateScrollOptions(dataTable),options);
  options=addOptions((BsfUtils.isStringValued(lang) ? "String_Node_Str" + lang + "String_Node_Str" : null),options);
  options=addOptions(generateColumnInfos(dataTable.getColumnInfo()),options);
  options=addOptions(dataTable.getCustomOptions(),options);
  rw.writeText(widgetVar + "String_Node_Str" + clientId+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ clientIdRaw.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ widgetVar+ "String_Node_Str"+ "String_Node_Str"+ widgetVar+ "String_Node_Str"+ options+ "String_Node_Str",null);
  if (dataTable.isMultiColumnSearch()) {
    rw.writeText("String_Node_Str" + widgetVar + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
    rw.writeText("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + widgetVar + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  }
  rw.writeText("String_Node_Str",null);
  rw.endElement("String_Node_Str");
}