nus-yam/ex-repair huggingface dataset:
Program: 56962
Project: 56962
Buggy source:
private Tag createTags(Tag tag){
  String ns=tag.getNamespace();
  if (HTML_NAMESPACE.equals(ns)) {
    active=true;
    TagAttributes modifiedAttributes=tag.getAttributes();
    if ("String_Node_Str".equals(tag.getLocalName())) {
      TagAttribute tagAttribute=modifiedAttributes.get(PASS_THROUGH_NAMESPACE,"String_Node_Str");
      if ("String_Node_Str".equals(tagAttribute.getValue())) {
        return convertElementToInputText(tag,modifiedAttributes);
      }
      if ("String_Node_Str".equals(tagAttribute.getValue())) {
        return convertDivElementToPanelGroup(tag,modifiedAttributes,true);
      }
    }
    Tag newTag=relaxedDecorator.decorate(tag);
    if (newTag != null && newTag != tag) {
      return newTag;
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertToInputText(tag,modifiedAttributes);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertDivTagToPanelGroup(tag,modifiedAttributes,true);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertDivTagToPanelGroup(tag,modifiedAttributes,false);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertTofSelectItemText(tag,modifiedAttributes);
    }
    tag=convertBootsFacesTag(tag);
  }
  return tag;
}

Fixed version (ground truth):
private Tag createTags(Tag tag){
  String ns=tag.getNamespace();
  if (HTML_NAMESPACE.equals(ns)) {
    active=true;
    TagAttributes modifiedAttributes=tag.getAttributes();
    if ("String_Node_Str".equals(tag.getLocalName())) {
      TagAttribute tagAttribute=modifiedAttributes.get(PASS_THROUGH_NAMESPACE,"String_Node_Str");
      if ("String_Node_Str".equals(tagAttribute.getValue())) {
        return convertElementToInputTag(tag,modifiedAttributes);
      }
      if ("String_Node_Str".equals(tagAttribute.getValue())) {
        return convertElementToSelectOneMenuTag(tag,modifiedAttributes);
      }
      if ("String_Node_Str".equals(tagAttribute.getValue())) {
        return convertDivElementToPanelGroup(tag,modifiedAttributes,true);
      }
    }
    Tag newTag=relaxedDecorator.decorate(tag);
    if (newTag != null && newTag != tag) {
      return newTag;
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertToInputTag(tag,modifiedAttributes);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertToSelectOneMenuTag(tag,modifiedAttributes);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertDivTagToPanelGroup(tag,modifiedAttributes,true);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertDivTagToPanelGroup(tag,modifiedAttributes,false);
    }
    if ("String_Node_Str".equals(tag.getLocalName())) {
      return convertTofSelectItemText(tag,modifiedAttributes);
    }
    tag=convertBootsFacesTag(tag);
  }
  return tag;
}
Program: 56963
Project: 56963
Buggy source:
/** 
 * Converts &lt;option&gt;firstComboboxItem&lt;/option&gt; to &lt;f:selectItem itemValue="firstComboxItem"&gt;.
 */
private Tag convertTofSelectItemText(Tag tag,TagAttributes attributeList){
  TagAttribute[] attributes=attributeList.getAll();
  AFTagAttributes more=new AFTagAttributes(attributes);
  Tag t=new Tag(tag.getLocation(),JSF_CORE_NAMESPACE,"String_Node_Str","String_Node_Str",more);
  return t;
}

Fixed version (ground truth):
/** 
 * Converts &lt;option&gt;firstComboboxItem&lt;/option&gt; to &lt;f:selectItem itemValue="firstComboxItem"&gt;.
 */
private Tag convertTofSelectItemText(Tag tag,TagAttributes attributeList){
  TagAttribute[] attributes=attributeList.getAll();
  AFTagAttributes more=new AFTagAttributes(attributes);
  more.replaceAttribute("String_Node_Str","String_Node_Str");
  more.replaceAttribute("String_Node_Str","String_Node_Str");
  Tag t=new Tag(tag.getLocation(),JSF_CORE_NAMESPACE,"String_Node_Str","String_Node_Str",more);
  return t;
}
Program: 56966
Project: 56966
Buggy source:
private String generateScrollOptions(DataTable dataTable){
  String scrollY=dataTable.getScrollSize();
  boolean scrollX=dataTable.isScrollX();
  if (null == scrollY && (!scrollX)) {
    return "String_Node_Str";
  }
  String result="String_Node_Str";
  if (null != scrollY) {
    if (!NUMERIC_PATTERN.matcher(scrollY).matches()) {
      scrollY="String_Node_Str" + scrollY + "String_Node_Str";
    }
    result+="String_Node_Str" + scrollY + "String_Node_Str";
  }
  if (scrollX) {
    result+="String_Node_Str";
  }
  return result + "String_Node_Str" + dataTable.isScrollCollapse()+ "String_Node_Str";
}

Fixed version (ground truth):
private String generateScrollOptions(DataTable dataTable){
  String scrollY=dataTable.getScrollSize();
  boolean scrollX=dataTable.isScrollX();
  if (null == scrollY && (!scrollX)) {
    return "String_Node_Str";
  }
  String result="String_Node_Str";
  if (null != scrollY) {
    if (!NUMERIC_PATTERN.matcher(scrollY).matches()) {
      scrollY="String_Node_Str" + scrollY + "String_Node_Str";
    }
    result+="String_Node_Str" + scrollY + "String_Node_Str";
  }
  if (scrollX) {
    result+="String_Node_Str";
  }
  return result + "String_Node_Str" + dataTable.isScrollCollapse();
}
Program: 56967
Project: 56967
Buggy source:
public Modal(){
  AddResourcesListener.addThemedCSSResource("String_Node_Str");
  AddResourcesListener.addThemedCSSResource("String_Node_Str");
  setRendererType(DEFAULT_RENDERER);
}

Fixed version (ground truth):
public Modal(){
  AddResourcesListener.addThemedCSSResource("String_Node_Str");
  AddResourcesListener.addThemedCSSResource("String_Node_Str");
  AddResourcesListener.addThemedCSSResource("String_Node_Str");
  setRendererType(DEFAULT_RENDERER);
}
Program: 56969
Project: 56969
Buggy source:
/** 
 * Get the style class
 * @param sb
 * @return
 */
private String getStyleClass(SocialButton sb){
  String sClass=sb.getStyleClass();
  if (sClass == null)   sClass="String_Node_Str";
  sClass+="String_Node_Str";
  if (sb.isOnlyIcon())   sClass+="String_Node_Str";
  sClass+=("String_Node_Str" + sb.getSocial());
  sClass+=Responsive.getResponsiveStyleClass(sb,false);
  return sClass;
}

Fixed version (ground truth):
/** 
 * Get the style class
 * @param sb
 * @return
 */
private String getStyleClass(SocialButton sb){
  String sClass=sb.getStyleClass();
  if (sClass == null)   sClass="String_Node_Str";
  sClass+="String_Node_Str";
  if (sb.isIconOnly())   sClass+="String_Node_Str";
  sClass+=("String_Node_Str" + sb.getSocial());
  sClass+=Responsive.getResponsiveStyleClass(sb,false);
  return sClass;
}
Program: 56970
Project: 56970
Buggy source:
/** 
 * This methods generates the HTML code of the current b:socialButton.
 * @param context the FacesContext.
 * @param component the current b:socialButton.
 * @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;
  }
  SocialButton socialButton=(SocialButton)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=socialButton.getClientId();
  rw.startElement("String_Node_Str",socialButton);
  rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  if (BsfUtils.isStringValued(socialButton.getHref()))   rw.writeAttribute("String_Node_Str",socialButton.getHref(),"String_Node_Str");
  if (BsfUtils.isStringValued(socialButton.getStyle()))   rw.writeAttribute("String_Node_Str",socialButton.getStyle(),"String_Node_Str");
  rw.writeAttribute("String_Node_Str",getStyleClass(socialButton),"String_Node_Str");
  Tooltip.generateTooltip(context,socialButton,rw);
  IconRenderer.encodeIcon(rw,socialButton,socialButton.getSocial(),true);
  if (!socialButton.isOnlyIcon() && BsfUtils.isStringValued(socialButton.getValue())) {
    rw.writeText(socialButton.getValue(),null);
  }
  rw.endElement("String_Node_Str");
  Tooltip.activateTooltips(context,socialButton);
}

Fixed version (ground truth):
/** 
 * This methods generates the HTML code of the current b:socialButton.
 * @param context the FacesContext.
 * @param component the current b:socialButton.
 * @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;
  }
  SocialButton socialButton=(SocialButton)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=socialButton.getClientId();
  rw.startElement("String_Node_Str",socialButton);
  rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
  rw.writeAttribute("String_Node_Str",clientId,"String_Node_Str");
  if (BsfUtils.isStringValued(socialButton.getHref()))   rw.writeAttribute("String_Node_Str",socialButton.getHref(),"String_Node_Str");
  if (BsfUtils.isStringValued(socialButton.getStyle()))   rw.writeAttribute("String_Node_Str",socialButton.getStyle(),"String_Node_Str");
  rw.writeAttribute("String_Node_Str",getStyleClass(socialButton),"String_Node_Str");
  Tooltip.generateTooltip(context,socialButton,rw);
  IconRenderer.encodeIcon(rw,socialButton,socialButton.getSocial(),true);
  if (!socialButton.isIconOnly() && BsfUtils.isStringValued(socialButton.getValue())) {
    rw.writeText(socialButton.getValue(),null);
  }
  rw.endElement("String_Node_Str");
  Tooltip.activateTooltips(context,socialButton);
}
Program: 56971
Project: 56971
Buggy source:
public void encodeHeader(FacesContext context,String h,UIComponent navlink) throws IOException {
  ResponseWriter rw=context.getResponseWriter();
  String htmlTag="String_Node_Str";
  UIComponent parent=navlink.getParent();
  if (parent != null) {
    if (parent instanceof DropButton || parent instanceof NavBar || parent instanceof TabLinks|| parent instanceof PillLinks|| parent instanceof ListLinks|| parent instanceof NavBarLinks|| parent instanceof DropMenu) {
      htmlTag="String_Node_Str";
    }
  }
  rw.startElement(htmlTag,navlink);
  writeAttribute(rw,"String_Node_Str",navlink.getClientId(context),"String_Node_Str");
  String styleClass=((AbstractNavLink)navlink).getStyleClass();
  if (null == styleClass) {
    styleClass="String_Node_Str";
  }
  styleClass="String_Node_Str" + styleClass + "String_Node_Str"+ Responsive.getResponsiveStyleClass((AbstractNavLink)navlink,false);
  writeAttribute(rw,"String_Node_Str",styleClass,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",((AbstractNavLink)navlink).getStyle(),"String_Node_Str");
  writeAttribute(rw,"String_Node_Str","String_Node_Str",null);
  rw.writeText(h,null);
  rw.endElement(htmlTag);
}

Fixed version (ground truth):
public void encodeHeader(FacesContext context,String h,UIComponent navlink) throws IOException {
  ResponseWriter rw=context.getResponseWriter();
  String htmlTag="String_Node_Str";
  UIComponent parent=navlink.getParent();
  if (parent != null) {
    if (parent instanceof DropButton || parent instanceof NavBar || parent instanceof TabLinks|| parent instanceof PillLinks|| parent instanceof ListLinks|| parent instanceof NavBarLinks|| parent instanceof DropMenu|| parent instanceof FlyOutMenu) {
      htmlTag="String_Node_Str";
    }
  }
  rw.startElement(htmlTag,navlink);
  writeAttribute(rw,"String_Node_Str",navlink.getClientId(context),"String_Node_Str");
  String styleClass=((AbstractNavLink)navlink).getStyleClass();
  if (null == styleClass) {
    styleClass="String_Node_Str";
  }
  styleClass="String_Node_Str" + styleClass + "String_Node_Str"+ Responsive.getResponsiveStyleClass((AbstractNavLink)navlink,false);
  writeAttribute(rw,"String_Node_Str",styleClass,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",((AbstractNavLink)navlink).getStyle(),"String_Node_Str");
  writeAttribute(rw,"String_Node_Str","String_Node_Str",null);
  rw.writeText(h,null);
  rw.endElement(htmlTag);
}
Program: 56972
Project: 56972
Buggy source:
/** 
 * Decode ajax behaviours specific to the components
 */
@Override public void decode(FacesContext context,UIComponent component){
  Tree tree=(Tree)component;
  super.decode(context,tree);
  final TreeNodeEventListener nodeSelectionListener=tree.getNodeSelectionListener();
  String params=context.getExternalContext().getRequestParameterMap().get("String_Node_Str");
  if (params != null && nodeSelectionListener != null) {
    if (params != null) {
      params=params.replace("String_Node_Str","String_Node_Str");
      String[] pair=params.split("String_Node_Str",2);
      String key=pair[0];
      String value=null;
      if (pair.length == 2) {
        value=pair[1];
      }
      if (value != null && !"String_Node_Str".equals(value.trim())) {
        Node n=TreeModelUtils.mapDataToModel(value);
        TreeModelUtils.updateNodeById(tree.getValue(),n.getNodeId(),n);
        if ("String_Node_Str".equals(key)) {
          Node n2=checkNodeIsSelected(tree.getValue(),tree);
          nodeSelectionListener.processValueChange(new TreeNodeSelectionEvent(n2,n));
        }
 else         if ("String_Node_Str".equals(key)) {
          nodeSelectionListener.processValueChecked(new TreeNodeCheckedEvent(n,true));
        }
 else         if ("String_Node_Str".equals(key)) {
          nodeSelectionListener.processValueUnchecked(new TreeNodeCheckedEvent(n,false));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Decode ajax behaviours specific to the components
 */
@Override public void decode(FacesContext context,UIComponent component){
  Tree tree=(Tree)component;
  super.decode(context,tree);
  final TreeNodeEventListener nodeSelectionListener=tree.getNodeSelectionListener();
  String params=context.getExternalContext().getRequestParameterMap().get("String_Node_Str");
  if (params != null) {
    params=params.replace("String_Node_Str","String_Node_Str");
    String[] pair=params.split("String_Node_Str",2);
    String key=pair[0];
    String value=null;
    if (pair.length == 2) {
      value=pair[1];
    }
    if (value != null && !"String_Node_Str".equals(value.trim())) {
      Node n=TreeModelUtils.mapDataToModel(value);
      TreeModelUtils.updateNodeById(tree.getValue(),n.getNodeId(),n);
      if (nodeSelectionListener != null) {
        if ("String_Node_Str".equals(key)) {
          Node n2=checkNodeIsSelected(tree.getValue(),tree);
          nodeSelectionListener.processValueChange(new TreeNodeSelectionEvent(n2,n));
        }
 else         if ("String_Node_Str".equals(key)) {
          nodeSelectionListener.processValueChecked(new TreeNodeCheckedEvent(n,true));
        }
 else         if ("String_Node_Str".equals(key)) {
          nodeSelectionListener.processValueUnchecked(new TreeNodeCheckedEvent(n,false));
        }
      }
    }
  }
}
Program: 56973
Project: 56973
Buggy source:
public void encodeHeader(FacesContext context,String h,UIComponent navlink) throws IOException {
  ResponseWriter rw=context.getResponseWriter();
  String htmlTag="String_Node_Str";
  UIComponent parent=navlink.getParent();
  if (parent != null) {
    if (parent instanceof DropButton || parent instanceof NavBar || parent instanceof TabLinks|| parent instanceof PillLinks|| parent instanceof ListLinks) {
      htmlTag="String_Node_Str";
    }
 else {
      System.out.println(parent.getClass().getName());
    }
  }
  rw.startElement(htmlTag,navlink);
  writeAttribute(rw,"String_Node_Str",navlink.getClientId(context),"String_Node_Str");
  String styleClass=((AbstractNavLink)navlink).getStyleClass();
  if (null == styleClass)   writeAttribute(rw,"String_Node_Str","String_Node_Str","String_Node_Str");
 else   writeAttribute(rw,"String_Node_Str","String_Node_Str" + styleClass,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",((AbstractNavLink)navlink).getStyle(),"String_Node_Str");
  writeAttribute(rw,"String_Node_Str","String_Node_Str",null);
  rw.writeText(h,null);
  rw.endElement(htmlTag);
}

Fixed version (ground truth):
public void encodeHeader(FacesContext context,String h,UIComponent navlink) throws IOException {
  ResponseWriter rw=context.getResponseWriter();
  String htmlTag="String_Node_Str";
  UIComponent parent=navlink.getParent();
  if (parent != null) {
    if (parent instanceof DropButton || parent instanceof NavBar || parent instanceof TabLinks|| parent instanceof PillLinks|| parent instanceof ListLinks|| parent instanceof NavBarLinks|| parent instanceof DropMenu) {
      htmlTag="String_Node_Str";
    }
  }
  rw.startElement(htmlTag,navlink);
  writeAttribute(rw,"String_Node_Str",navlink.getClientId(context),"String_Node_Str");
  String styleClass=((AbstractNavLink)navlink).getStyleClass();
  if (null == styleClass)   writeAttribute(rw,"String_Node_Str","String_Node_Str","String_Node_Str");
 else   writeAttribute(rw,"String_Node_Str","String_Node_Str" + styleClass,"String_Node_Str");
  writeAttribute(rw,"String_Node_Str",((AbstractNavLink)navlink).getStyle(),"String_Node_Str");
  writeAttribute(rw,"String_Node_Str","String_Node_Str",null);
  rw.writeText(h,null);
  rw.endElement(htmlTag);
}
Program: 56975
Project: 56975
Buggy source:
/** 
 * Comma separated list of child panel id that need to render expanded. <P>
 * @return Returns the value of the attribute, or null, if it hasn't beenset by the JSF file.
 */
public String getExpandedPanels(){
  String value=(String)getStateHelper().eval(PropertyKeys.expandedPanels);
  return value;
}

Fixed version (ground truth):
/** 
 * Comma separated list of child panel id that need to render expanded. <P>
 * @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file.
 */
public String getExpandedPanels(){
  return (String)getStateHelper().eval(PropertyKeys.expandedPanels);
}
Program: 56976
Project: 56976
Buggy source:
private String findHighestSeverityClass(List<FacesMessage> messageList,Message message){
  boolean hasFatal=false;
  boolean hasError=false;
  boolean hasWarning=false;
  for (  FacesMessage msg : messageList) {
    Severity severity=msg.getSeverity();
    if (msg.isRendered() && !message.isRedisplay()) {
      continue;
    }
    if (severity.equals(FacesMessage.SEVERITY_WARN))     hasWarning=true;
 else     if (severity.equals(FacesMessage.SEVERITY_ERROR))     hasError=true;
 else     if (severity.equals(FacesMessage.SEVERITY_FATAL))     hasFatal=true;
  }
  if (hasFatal)   return "String_Node_Str";
  if (hasError)   return "String_Node_Str";
  if (hasWarning)   return "String_Node_Str";
  return "String_Node_Str";
}

Fixed version (ground truth):
private String findHighestSeverityClass(List<FacesMessage> messageList,Message message){
  boolean hasFatal=false;
  boolean hasError=false;
  boolean hasWarning=false;
  for (  FacesMessage msg : messageList) {
    Severity severity=msg.getSeverity();
    if (msg.isRendered() && !message.isRedisplay()) {
      continue;
    }
    if (severity.equals(FacesMessage.SEVERITY_WARN))     hasWarning=true;
 else     if (severity.equals(FacesMessage.SEVERITY_ERROR))     hasError=true;
 else     if (severity.equals(FacesMessage.SEVERITY_FATAL))     hasFatal=true;
  }
  if (hasFatal)   return ("String_Node_Str" + message.getFatalClass());
  if (hasError)   return ("String_Node_Str" + message.getErrorClass());
  if (hasWarning)   return ("String_Node_Str" + message.getWarnClass());
  return ("String_Node_Str" + message.getInfoClass());
}
Program: 56982
Project: 56982
Buggy source:
/** 
 * Get the item to update after an ajax request
 * @return
 */
public String getUpdate(){
  String value=(String)getStateHelper().eval(PropertyKeys.update);
  return value;
}

Fixed version (ground truth):
/** 
 * Get the item to update after an ajax request
 * @return
 */
public String getUpdate(){
  String value=(String)getStateHelper().eval(PropertyKeys.update,null);
  return value;
}
Program: 56985
Project: 56985
Buggy source:
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Tree tree=(Tree)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=tree.getClientId();
  final UIForm form=BsfUtils.getClosestForm(tree);
  if (form == null) {
    throw new FacesException("String_Node_Str",null);
  }
  rw.startElement("String_Node_Str",tree);
  rw.writeAttribute("String_Node_Str","String_Node_Str" + clientId,"String_Node_Str");
  rw.endElement("String_Node_Str");
}

Fixed version (ground truth):
@Override public void encodeBegin(FacesContext context,UIComponent component) throws IOException {
  if (!component.isRendered()) {
    return;
  }
  Tree tree=(Tree)component;
  ResponseWriter rw=context.getResponseWriter();
  String clientId=tree.getClientId();
  final UIForm form=BsfUtils.getClosestForm(tree);
  if (form == null) {
    throw new FacesException("String_Node_Str",null);
  }
  rw.startElement("String_Node_Str",tree);
  rw.writeAttribute("String_Node_Str","String_Node_Str" + clientId,"String_Node_Str");
  renderPassThruAttributes(context,component,H.HTML5_DATA_ATTRIBUTES,true);
  rw.endElement("String_Node_Str");
}
Program: 56987
Project: 56987
Buggy source:
/** 
 * Algorithm works as follows; - If it's an input component, submitted value is checked first since it'd be the value to be used in case validation errors terminates jsf lifecycle - Finally the value of the component is retrieved from backing bean and if there's a converter, converted value is returned
 * @param fc FacesContext instance
 * @param c UIComponent instance whose value will be returned
 * @return End text
 */
public String getValue2Render(FacesContext fc,UIComponent c){
  if (c instanceof ValueHolder) {
    if (c instanceof EditableValueHolder) {
      Object sv=((EditableValueHolder)c).getSubmittedValue();
      if (sv != null) {
        return sv.toString();
      }
    }
    ValueHolder vh=(ValueHolder)c;
    Object val=vh.getValue();
    if (val != null) {
      Converter converter=getConverter(fc,vh);
      if (converter != null)       return converter.getAsString(fc,c,val);
 else       return val.toString();
    }
 else {
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Algorithm works as follows; - If it's an input component, submitted value is checked first since it'd be the value to be used in case validation errors terminates jsf lifecycle - Finally the value of the component is retrieved from backing bean and if there's a converter, converted value is returned
 * @param fc FacesContext instance
 * @param c UIComponent instance whose value will be returned
 * @return End text
 */
public String getValue2Render(FacesContext fc,UIComponent c){
  if (c instanceof ValueHolder) {
    if (c instanceof EditableValueHolder) {
      Object sv=((EditableValueHolder)c).getSubmittedValue();
      if (sv != null) {
        return sv.toString();
      }
    }
    ValueHolder vh=(ValueHolder)c;
    Object val=vh.getValue();
    if (val != null) {
      Converter converter=vh.getConverter();
      if (converter == null) {
        Class<?> valueType=val.getClass();
        if (valueType == String.class) {
          return (String)val;
        }
        converter=fc.getApplication().createConverter(valueType);
      }
      if (converter != null)       return converter.getAsString(fc,c,val);
 else       return val.toString();
    }
 else {
      return null;
    }
  }
  return null;
}
Program: 56989
Project: 56989
Buggy source:
/** 
 * Set the map cntaining the DataTable properties for this instance.
 * @param _dataTableProperties The map
 */
public void setDataTableProperties(Map<DataTablePropertyType,Object> _dataTableProperties){
  getStateHelper().put(PropertyKeys.dataTableProperties,_dataTableProperties);
}

Fixed version (ground truth):
/** 
 * Set the map containing the DataTable properties for this instance. <p> EXPERIMENTAL: Does not support multiple DataTables on the same page.
 * @param _dataTableProperties The map
 */
public void setDataTableProperties(Map<DataTablePropertyType,Object> _dataTableProperties){
  getStateHelper().put(PropertyKeys.dataTableProperties,_dataTableProperties);
}
Program: 56991
Project: 56991
Buggy source:
@Override public Object put(String key,Object value){
  if ("String_Node_Str".equals(key))   realMap.put("String_Node_Str",value);
  if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))   key="String_Node_Str";
  if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))   key="String_Node_Str";
  if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))   key="String_Node_Str";
  if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))   key="String_Node_Str";
  if ("String_Node_Str".equals(key))   key="String_Node_Str";
  if (key != null && key.indexOf('-') > 0) {
    StringBuilder newKey=new StringBuilder(key.length());
    boolean toUpperCase=false;
    for (    char c : key.toCharArray()) {
      if (c == '-')       toUpperCase=true;
 else {
        if (toUpperCase) {
          toUpperCase=false;
          c=Character.toUpperCase(c);
        }
        newKey.append(c);
      }
    }
    Object newValue=value;
    if (key.startsWith("String_Node_Str")) {
      newValue=new Integer((String)value);
    }
    realMap.put(key,value);
    return realMap.put(newKey.toString(),newValue);
  }
  return realMap.put(key,value);
}

Fixed version (ground truth):
@Override public Object put(String key,Object value){
  try {
    if ("String_Node_Str".equals(key))     realMap.put("String_Node_Str",value);
    if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))     key="String_Node_Str";
    if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))     key="String_Node_Str";
    if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))     key="String_Node_Str";
    if (("String_Node_Str".equals(key)) || ("String_Node_Str".equals(key)))     key="String_Node_Str";
    if ("String_Node_Str".equals(key))     key="String_Node_Str";
    if (key != null && key.indexOf('-') > 0) {
      StringBuilder newKey=new StringBuilder(key.length());
      boolean toUpperCase=false;
      for (      char c : key.toCharArray()) {
        if (c == '-')         toUpperCase=true;
 else {
          if (toUpperCase) {
            toUpperCase=false;
            c=Character.toUpperCase(c);
          }
          newKey.append(c);
        }
      }
      Object newValue=value;
      if (key.startsWith("String_Node_Str")) {
        newValue=new Integer((String)value);
      }
      if (newKey.toString().equals("String_Node_Str")) {
        newValue=new Boolean((String)value);
      }
 else       newValue=convertValueToType(newKey.toString(),value);
      realMap.put(key,value);
      return realMap.put(newKey.toString(),newValue);
    }
    return realMap.put(key,convertValueToType(key,value));
  }
 catch (  Exception e) {
    System.out.println(e);
  }
  return null;
}
Program: 56992
Project: 56992
Buggy source:
public AttributeMapWrapper(Map<String,Object> realMap){
  this.realMap=realMap;
}

Fixed version (ground truth):
public AttributeMapWrapper(Object component,Map<String,Object> realMap){
  this.realMap=realMap;
}
Program: 56993
Project: 56993
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56994
Project: 56994
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56995
Project: 56995
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56996
Project: 56996
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56997
Project: 56997
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56998
Project: 56998
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 56999
Project: 56999
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57000
Project: 57000
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57001
Project: 57001
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57002
Project: 57002
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57003
Project: 57003
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57004
Project: 57004
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57005
Project: 57005
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57006
Project: 57006
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57007
Project: 57007
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57008
Project: 57008
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57009
Project: 57009
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57010
Project: 57010
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57011
Project: 57011
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57012
Project: 57012
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57013
Project: 57013
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57014
Project: 57014
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57015
Project: 57015
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57016
Project: 57016
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57017
Project: 57017
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57018
Project: 57018
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57019
Project: 57019
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57020
Project: 57020
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57021
Project: 57021
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57022
Project: 57022
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57023
Project: 57023
Buggy source:
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(super.getAttributes());
  return attributes;
}

Fixed version (ground truth):
@Override public Map<String,Object> getAttributes(){
  if (attributes == null)   attributes=new AttributeMapWrapper(this,super.getAttributes());
  return attributes;
}
Program: 57031
Project: 57031
Buggy source:
/** 
 * Start the column span div (if there's one). This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected int startColSpanDiv(ResponseWriter rw,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  int span=selectBooleanCheckbox.getSpan();
  if (span > 0) {
    rw.startElement("String_Node_Str",selectBooleanCheckbox);
    rw.writeAttribute("String_Node_Str","String_Node_Str" + span,"String_Node_Str");
  }
  return span;
}

Fixed version (ground truth):
/** 
 * Start the column span div (if there's one). This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected int startColSpanDiv(ResponseWriter rw,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  int span=selectBooleanCheckbox.getSpan();
  if (span > 0) {
    rw.startElement("String_Node_Str",selectBooleanCheckbox);
    rw.writeAttribute("String_Node_Str","String_Node_Str" + span,"String_Node_Str");
    if (null != selectBooleanCheckbox.getDir()) {
      rw.writeAttribute("String_Node_Str",selectBooleanCheckbox.getDir(),"String_Node_Str");
    }
  }
  return span;
}
Program: 57033
Project: 57033
Buggy source:
/** 
 * Renders the optional label. This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param clientId the id used by the label to reference the input field
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected void addLabel(ResponseWriter rw,String clientId,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  if (selectBooleanCheckbox.isRenderLabel()) {
    String label=selectBooleanCheckbox.getLabel();
    if (label != null) {
      rw.startElement("String_Node_Str",selectBooleanCheckbox);
      rw.writeAttribute("String_Node_Str","String_Node_Str" + clientId,"String_Node_Str");
      rw.writeText(label,null);
      rw.endElement("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Renders the optional label. This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param clientId the id used by the label to reference the input field
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected void addLabel(ResponseWriter rw,String clientId,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  if (selectBooleanCheckbox.isRenderLabel()) {
    String label=selectBooleanCheckbox.getLabel();
    if (label != null) {
      rw.startElement("String_Node_Str",selectBooleanCheckbox);
      if (null != selectBooleanCheckbox.getDir()) {
        rw.writeAttribute("String_Node_Str",selectBooleanCheckbox.getDir(),"String_Node_Str");
      }
      rw.writeAttribute("String_Node_Str","String_Node_Str" + clientId,"String_Node_Str");
      rw.writeText(label,null);
      rw.endElement("String_Node_Str");
    }
  }
}
Program: 57034
Project: 57034
Buggy source:
/** 
 * Starts the input field group (if needed to display a component seamlessly in front of or behind the input field). This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param hasPrependingAddOn
 * @param hasAppendingAddOn
 * @param selectBooleanCheckbox the component to render
 * @return true if there is an add-on in front of or behind the input field
 * @throws IOException may be thrown by the response writer
 */
protected boolean startInputGroupForAddOn(ResponseWriter rw,boolean hasPrependingAddOn,boolean hasAppendingAddOn,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  final boolean hasAddon=hasAppendingAddOn || hasPrependingAddOn;
  if (hasAddon) {
    rw.startElement("String_Node_Str",selectBooleanCheckbox);
    rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
  }
  return hasAddon;
}

Fixed version (ground truth):
/** 
 * Starts the input field group (if needed to display a component seamlessly in front of or behind the input field). This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param hasPrependingAddOn
 * @param hasAppendingAddOn
 * @param selectBooleanCheckbox the component to render
 * @return true if there is an add-on in front of or behind the input field
 * @throws IOException may be thrown by the response writer
 */
protected boolean startInputGroupForAddOn(ResponseWriter rw,boolean hasPrependingAddOn,boolean hasAppendingAddOn,SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
  final boolean hasAddon=hasAppendingAddOn || hasPrependingAddOn;
  if (hasAddon) {
    rw.startElement("String_Node_Str",selectBooleanCheckbox);
    rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
    if (null != selectBooleanCheckbox.getDir()) {
      rw.writeAttribute("String_Node_Str",selectBooleanCheckbox.getDir(),"String_Node_Str");
    }
  }
  return hasAddon;
}
Program: 57035
Project: 57035
Buggy source:
/** 
 * Renders the start of the input tag. This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected void renderInputTag(ResponseWriter rw,FacesContext context,SelectBooleanCheckbox selectBooleanCheckbox,String clientId) throws IOException {
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
  rw.writeAttribute("String_Node_Str",clientId,null);
  Tooltip.generateTooltip(context,selectBooleanCheckbox,rw);
  rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
}

Fixed version (ground truth):
/** 
 * Renders the start of the input tag. This method is protected in order to allow third-party frameworks to derive from it.
 * @param rw the response writer
 * @param selectBooleanCheckbox the component to render
 * @throws IOException may be thrown by the response writer
 */
protected void renderInputTag(ResponseWriter rw,FacesContext context,SelectBooleanCheckbox selectBooleanCheckbox,String clientId) throws IOException {
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
  rw.writeAttribute("String_Node_Str",clientId,null);
  if (null != selectBooleanCheckbox.getDir()) {
    rw.writeAttribute("String_Node_Str",selectBooleanCheckbox.getDir(),"String_Node_Str");
  }
  Tooltip.generateTooltip(context,selectBooleanCheckbox,rw);
  rw.writeAttribute("String_Node_Str","String_Node_Str","String_Node_Str");
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
  rw.startElement("String_Node_Str",selectBooleanCheckbox);
}