Program: 42457
Project: 42457
Buggy source:
/** 
 * Collect data from the human task form data
 * @param form
 * @param data data JSON returned from the API
 * @return
 * @throws Throwable
 * @note the visit is destructive of the data field
 */
private static void fetchHumanTaskFormData(final KieProcessFormQueryResult form,final JSONObject data,Map<String,Object> result) throws Throwable {
  if (null == form || null == data) {
    return;
  }
  if (null != form.getNestedForms() && !form.getNestedForms().isEmpty()) {
    for (    KieProcessFormQueryResult subForm : form.getNestedForms()) {
      getHumanTaskFormData(subForm,data,result);
    }
  }
  if (null == form.getFields() || form.getFields().isEmpty()) {
    return;
  }
  KieDataHolder dataModeler=BpmToFormHelper.getFormDataModelerEntry(form);
  Object obj=JsonHelper.findKey(data,dataModeler.getValue());
  if (null == obj || !(obj instanceof JSONObject)) {
    throw new RuntimeException("String_Node_Str" + dataModeler.getValue());
  }
  JSONObject section=(JSONObject)obj;
  String sectionName=dataModeler.getId();
  List<String> sectionFields=new ArrayList<>();
  for (  KieProcessFormField field : form.getFields()) {
    String jsonName=FormToBpmHelper.generateFieldNameForInput(field,sectionName);
    Object value=null;
    try {
      value=section.get(jsonName);
    }
 catch (    org.json.JSONException ex) {
    }
    if (JSONObject.NULL == value) {
      result.put(field.getName(),null);
    }
 else {
      result.put(field.getName(),value);
    }
  }
  for (  String name : JSONObject.getNames(section)) {
    final String key=generateFieldNameForOutput(name,sectionName);
    final Object value=section.get(name);
    if (value instanceof JSONObject) {
      continue;
    }
    if (JSONObject.NULL == value) {
      result.put(key,null);
    }
 else {
      result.put(key,value);
    }
  }
  JsonHelper.replaceKey(data,dataModeler.getValue(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Collect data from the human task form data
 * @param form
 * @param data data JSON returned from the API
 * @return
 * @throws Throwable
 * @note the visit is destructive of the data field
 */
private static void fetchHumanTaskFormData(final KieProcessFormQueryResult form,final JSONObject data,Map<String,Object> result) throws Throwable {
  if (null == form || null == data) {
    return;
  }
  if (null != form.getNestedForms() && !form.getNestedForms().isEmpty()) {
    for (    KieProcessFormQueryResult subForm : form.getNestedForms()) {
      getHumanTaskFormData(subForm,data,result);
    }
  }
  if (null == form.getFields() || form.getFields().isEmpty()) {
    return;
  }
  KieDataHolder dataModeler=BpmToFormHelper.getFormDataModelerEntry(form);
  if (dataModeler != null) {
    Object obj=JsonHelper.findKey(data,dataModeler.getValue());
    if (null == obj || !(obj instanceof JSONObject)) {
      throw new RuntimeException("String_Node_Str" + dataModeler.getValue());
    }
    JSONObject section=(JSONObject)obj;
    String sectionName=dataModeler.getId();
    List<String> sectionFields=new ArrayList<>();
    for (    KieProcessFormField field : form.getFields()) {
      String jsonName=FormToBpmHelper.generateFieldNameForInput(field,sectionName);
      Object value=null;
      try {
        value=section.get(jsonName);
      }
 catch (      org.json.JSONException ex) {
      }
      if (JSONObject.NULL == value) {
        result.put(field.getName(),null);
      }
 else {
        result.put(field.getName(),value);
      }
    }
    for (    String name : JSONObject.getNames(section)) {
      final String key=generateFieldNameForOutput(name,sectionName);
      final Object value=section.get(name);
      if (value instanceof JSONObject) {
        continue;
      }
      if (JSONObject.NULL == value) {
        result.put(key,null);
      }
 else {
        result.put(key,value);
      }
    }
    JsonHelper.replaceKey(data,dataModeler.getValue(),"String_Node_Str");
  }
}