Program: 143447
Project: 143447
Buggy source:
protected <ContextT>void writeTemplateJSONContent(JSONWriter writer,ComponentTypeFormElementValue formElementValue,String forFoundsetPropertyType,FormElement componentFormElement,IModelWriter modelWriter,List<String> recordBasedProperties) throws JSONException {
  if (forFoundsetPropertyType != null)   writer.key(FoundsetLinkedPropertyType.FOR_FOUNDSET_PROPERTY_NAME).value(forFoundsetPropertyType);
  writer.key("String_Node_Str").value(componentFormElement.getTypeName());
  writer.key("String_Node_Str").value(componentFormElement.getName());
  writer.key("String_Node_Str");
  try {
    modelWriter.writeComponentModel();
  }
 catch (  JSONException|IllegalArgumentException e) {
    Debug.error("String_Node_Str" + componentFormElement.getTagname() + "String_Node_Str",e);
    throw e;
  }
  writer.key("String_Node_Str").object();
  for (  String handleMethodName : componentFormElement.getHandlers()) {
    writer.key(handleMethodName);
    JSONObject handlerInfo=new JSONObject();
    handlerInfo.put("String_Node_Str",componentFormElement.getForm().getName());
    handlerInfo.put("String_Node_Str",componentFormElement.getName());
    writer.value(handlerInfo);
  }
  writer.endObject();
  if (forFoundsetPropertyType != null) {
    writer.key(MODEL_VIEWPORT_KEY).array().endArray();
    writer.key(FOUNDSET_CONFIG_PROPERTY_NAME).object();
    if (recordBasedProperties != null) {
      writer.key(RECORD_BASED_PROPERTIES).array();
      for (      String propertyName : recordBasedProperties) {
        writer.value(propertyName);
      }
      writer.endArray();
    }
    if (formElementValue.apisOnAll != null) {
      writer.key(API_CALL_TYPES_KEY).array();
      for (      String methodName : formElementValue.apisOnAll) {
        writer.object().key(methodName).value(CALL_ON_ALL_RECORDS).endObject();
      }
      writer.endArray();
    }
    writer.endObject();
  }
}

Fixed version (ground truth):
protected <ContextT>void writeTemplateJSONContent(JSONWriter writer,ComponentTypeFormElementValue formElementValue,String forFoundsetPropertyType,FormElementContext componentFormElementContext,IModelWriter modelWriter,List<String> recordBasedProperties) throws JSONException {
  if (forFoundsetPropertyType != null)   writer.key(FoundsetLinkedPropertyType.FOR_FOUNDSET_PROPERTY_NAME).value(forFoundsetPropertyType);
  writer.key("String_Node_Str").value(componentFormElementContext.getFormElement().getTypeName());
  writer.key("String_Node_Str").value(componentFormElementContext.getName());
  writer.key("String_Node_Str");
  try {
    modelWriter.writeComponentModel();
  }
 catch (  JSONException|IllegalArgumentException e) {
    Debug.error("String_Node_Str" + componentFormElementContext.getFormElement().getTagname() + "String_Node_Str",e);
    throw e;
  }
  writer.key("String_Node_Str").object();
  for (  String handleMethodName : componentFormElementContext.getFormElement().getHandlers()) {
    writer.key(handleMethodName);
    JSONObject handlerInfo=new JSONObject();
    handlerInfo.put("String_Node_Str",componentFormElementContext.getFormElement().getForm().getName());
    handlerInfo.put("String_Node_Str",componentFormElementContext.getName());
    writer.value(handlerInfo);
  }
  writer.endObject();
  if (forFoundsetPropertyType != null) {
    writer.key(MODEL_VIEWPORT_KEY).array().endArray();
    writer.key(FOUNDSET_CONFIG_PROPERTY_NAME).object();
    if (recordBasedProperties != null) {
      writer.key(RECORD_BASED_PROPERTIES).array();
      for (      String propertyName : recordBasedProperties) {
        writer.value(propertyName);
      }
      writer.endArray();
    }
    if (formElementValue.apisOnAll != null) {
      writer.key(API_CALL_TYPES_KEY).array();
      for (      String methodName : formElementValue.apisOnAll) {
        writer.object().key(methodName).value(CALL_ON_ALL_RECORDS).endObject();
      }
      writer.endArray();
    }
    writer.endObject();
  }
}