Program: 33446
Project: 33446
Buggy source:
public Element getAsElement(){
  Element el=new Element("String_Node_Str");
  el.setAttribute("String_Node_Str",this.getUrl());
  el.setAttribute("String_Node_Str",String.valueOf(this.enabled));
  el.setAttribute("String_Node_Str",String.valueOf(this.payloadFormat).toLowerCase());
  el.setAttribute("String_Node_Str",String.valueOf(this.payloadTemplate));
  Element statesEl=new Element("String_Node_Str");
  for (  BuildStateEnum state : states.getStateSet()) {
    Element e=new Element("String_Node_Str");
    e.setAttribute("String_Node_Str",state.getShortName());
    e.setAttribute("String_Node_Str",Boolean.toString(states.enabled(state)));
    statesEl.addContent(e);
  }
  el.addContent(statesEl);
  Element buildsEl=new Element("String_Node_Str");
  buildsEl.setAttribute("String_Node_Str",Boolean.toString(isEnabledForAllBuildsInProject()));
  buildsEl.setAttribute("String_Node_Str",Boolean.toString(isEnabledForSubProjects()));
  if (this.enabledBuildTypesSet.size() > 0) {
    for (    String i : enabledBuildTypesSet) {
      Element e=new Element("String_Node_Str");
      e.setAttribute("String_Node_Str",i);
      buildsEl.addContent(e);
    }
  }
  el.addContent(buildsEl);
  if (this.filters.size() > 0) {
    Element filtersEl=new Element("String_Node_Str");
    for (    WebHookFilterConfig f : this.filters) {
      filtersEl.addContent(f.getAsElement());
    }
    el.addContent(filtersEl);
  }
  if (this.extraParameters.size() > 0) {
    Element paramsEl=new Element("String_Node_Str");
    for (    String i : this.extraParameters.keySet()) {
      paramsEl.addContent(this.getKeyAndValueAsElement(this.extraParameters,i,"String_Node_Str"));
    }
    el.addContent(paramsEl);
  }
  if (this.templates.size() > 0) {
    Element templatesEl=new Element("String_Node_Str");
    for (    CustomMessageTemplate t : this.templates.values()) {
      templatesEl.addContent(t.getAsElement());
    }
    el.addContent(templatesEl);
  }
  if (this.authType != "String_Node_Str") {
    Element authEl=new Element("String_Node_Str");
    authEl.setAttribute("String_Node_Str",this.authEnabled.toString());
    authEl.setAttribute("String_Node_Str",this.authType);
    authEl.setAttribute("String_Node_Str",this.authPreemptive.toString());
    if (this.authParameters.size() > 0) {
      Element paramsEl=new Element("String_Node_Str");
      for (      String i : this.authParameters.keySet()) {
        paramsEl.addContent(this.getKeyAndValueAsElement(this.authParameters,i,"String_Node_Str"));
      }
      authEl.addContent(paramsEl);
    }
    el.addContent(authEl);
  }
  return el;
}

Fixed version (ground truth):
public Element getAsElement(){
  Element el=new Element("String_Node_Str");
  el.setAttribute("String_Node_Str",this.getUrl());
  el.setAttribute("String_Node_Str",String.valueOf(this.enabled));
  el.setAttribute("String_Node_Str",String.valueOf(this.payloadFormat).toLowerCase());
  el.setAttribute("String_Node_Str",String.valueOf(this.payloadTemplate));
  Element statesEl=new Element("String_Node_Str");
  for (  BuildStateEnum state : states.getStateSet()) {
    Element e=new Element("String_Node_Str");
    e.setAttribute("String_Node_Str",state.getShortName());
    e.setAttribute("String_Node_Str",Boolean.toString(states.enabled(state)));
    statesEl.addContent(e);
  }
  el.addContent(statesEl);
  Element buildsEl=new Element("String_Node_Str");
  buildsEl.setAttribute("String_Node_Str",Boolean.toString(isEnabledForAllBuildsInProject()));
  buildsEl.setAttribute("String_Node_Str",Boolean.toString(isEnabledForSubProjects()));
  if (this.enabledBuildTypesSet.size() > 0) {
    for (    String i : enabledBuildTypesSet) {
      Element e=new Element("String_Node_Str");
      e.setAttribute("String_Node_Str",i);
      buildsEl.addContent(e);
    }
  }
  el.addContent(buildsEl);
  if (this.filters != null && this.filters.size() > 0) {
    Element filtersEl=new Element("String_Node_Str");
    for (    WebHookFilterConfig f : this.filters) {
      filtersEl.addContent(f.getAsElement());
    }
    el.addContent(filtersEl);
  }
  if (this.extraParameters.size() > 0) {
    Element paramsEl=new Element("String_Node_Str");
    for (    String i : this.extraParameters.keySet()) {
      paramsEl.addContent(this.getKeyAndValueAsElement(this.extraParameters,i,"String_Node_Str"));
    }
    el.addContent(paramsEl);
  }
  if (this.templates.size() > 0) {
    Element templatesEl=new Element("String_Node_Str");
    for (    CustomMessageTemplate t : this.templates.values()) {
      templatesEl.addContent(t.getAsElement());
    }
    el.addContent(templatesEl);
  }
  if (this.authType != "String_Node_Str") {
    Element authEl=new Element("String_Node_Str");
    authEl.setAttribute("String_Node_Str",this.authEnabled.toString());
    authEl.setAttribute("String_Node_Str",this.authType);
    authEl.setAttribute("String_Node_Str",this.authPreemptive.toString());
    if (this.authParameters.size() > 0) {
      Element paramsEl=new Element("String_Node_Str");
      for (      String i : this.authParameters.keySet()) {
        paramsEl.addContent(this.getKeyAndValueAsElement(this.authParameters,i,"String_Node_Str"));
      }
      authEl.addContent(paramsEl);
    }
    el.addContent(authEl);
  }
  return el;
}