Program: 57046
Project: 57046
Buggy source:
public static void generateBootsFacesAJAXAndJavaScript(FacesContext context,ClientBehaviorHolder component,ResponseWriter rw,String specialEvent,String specialEventHandler) throws IOException {
  Map<String,List<ClientBehavior>> clientBehaviors=component.getClientBehaviors();
  Collection<String> eventNames=component.getEventNames();
  for (  String keyClientBehavior : eventNames) {
    String jsCallback="String_Node_Str";
    String nameOfGetter="String_Node_Str" + keyClientBehavior;
    try {
      Method[] methods=component.getClass().getMethods();
      for (      Method m : methods) {
        if (m.getParameterTypes().length == 0) {
          if (m.getReturnType() == String.class) {
            if (m.getName().equalsIgnoreCase(nameOfGetter)) {
              jsCallback=(String)m.invoke(component);
              if (keyClientBehavior.equals(specialEvent)) {
                if (null == jsCallback || jsCallback.length() == 0)                 jsCallback=specialEventHandler;
 else                 jsCallback=jsCallback + "String_Node_Str" + specialEventHandler;
              }
              jsCallback=convertAJAXToJavascript(context,jsCallback,component);
              break;
            }
          }
        }
      }
    }
 catch (    ReflectiveOperationException ex) {
      System.err.println("String_Node_Str" + nameOfGetter);
    }
    String script="String_Node_Str";
    List<ClientBehavior> behaviors=clientBehaviors.get(keyClientBehavior);
    if (null != behaviors) {
      for (      ClientBehavior cb : behaviors) {
        ClientBehaviorContext behaviorContext=ClientBehaviorContext.createClientBehaviorContext(context,(UIComponent)component,keyClientBehavior,null,null);
        String s=buildAjaxCommand(behaviorContext,(AjaxBehavior)cb,false);
        script+=cb.getScript(behaviorContext) + "String_Node_Str";
      }
    }
    if (jsCallback.length() > 0 || script.length() > 0) {
      if (jsCallback.length() > 0 && "String_Node_Str".equals(keyClientBehavior))       script+="String_Node_Str";
      rw.writeAttribute("String_Node_Str" + keyClientBehavior,jsCallback + script,null);
    }
  }
}

Fixed version (ground truth):
public static void generateBootsFacesAJAXAndJavaScript(FacesContext context,ClientBehaviorHolder component,ResponseWriter rw,String specialEvent,String specialEventHandler) throws IOException {
  Map<String,List<ClientBehavior>> clientBehaviors=component.getClientBehaviors();
  Collection<String> eventNames=component.getEventNames();
  for (  String keyClientBehavior : eventNames) {
    String jsCallback="String_Node_Str";
    String nameOfGetter="String_Node_Str" + keyClientBehavior;
    try {
      Method[] methods=component.getClass().getMethods();
      for (      Method m : methods) {
        if (m.getParameterTypes().length == 0) {
          if (m.getReturnType() == String.class) {
            if (m.getName().equalsIgnoreCase(nameOfGetter)) {
              jsCallback=(String)m.invoke(component);
              if (keyClientBehavior.equals(specialEvent)) {
                if (null == jsCallback || jsCallback.length() == 0)                 jsCallback=specialEventHandler;
 else                 jsCallback=jsCallback + "String_Node_Str" + specialEventHandler;
              }
              jsCallback=convertAJAXToJavascript(context,jsCallback,component);
              break;
            }
          }
        }
      }
    }
 catch (    ReflectiveOperationException ex) {
      System.err.println("String_Node_Str" + nameOfGetter);
    }
    String script="String_Node_Str";
    List<ClientBehavior> behaviors=clientBehaviors.get(keyClientBehavior);
    if (null != behaviors) {
      for (      ClientBehavior cb : behaviors) {
        ClientBehaviorContext behaviorContext=ClientBehaviorContext.createClientBehaviorContext(context,(UIComponent)component,keyClientBehavior,null,null);
        String s=buildAjaxCommand(behaviorContext,(AjaxBehavior)cb,false);
        script+=cb.getScript(behaviorContext) + "String_Node_Str";
      }
    }
    if (jsCallback.length() > 0 || script.length() > 0) {
      if (component instanceof CommandButton)       if (jsCallback.length() > 0 && "String_Node_Str".equals(keyClientBehavior))       script+="String_Node_Str";
      rw.writeAttribute("String_Node_Str" + keyClientBehavior,jsCallback + script,null);
    }
  }
}