Program: 143449
Project: 143449
Buggy source:
/** 
 * Writes the entire value of this property as JSON. This includes the template values, not just the runtime component properties. This is currently needed and can get called if the property is nested inside other complex properties (json object/array) that sometimes might want/need to send again the entire content.
 */
public JSONWriter fullToJSON(final JSONWriter writer,DataConversion conversionMarkers,ComponentPropertyType componentPropertyType) throws JSONException {
  if (conversionMarkers != null)   conversionMarkers.convert(ComponentPropertyType.TYPE_NAME);
  final FormElement fe=formElementValue.element;
  writer.object();
  final TypedData<Map<String,Object>> formElementProperties=fe.propertiesForTemplateJSON();
  final TypedData<Map<String,Object>> runtimeProperties=childComponent.getProperties();
  childComponent.getAndClearChanges();
  boolean templateValuesRemoved=false;
  Iterator<Entry<String,Object>> formElementPropertyIterator=formElementProperties.content.entrySet().iterator();
  while (formElementPropertyIterator.hasNext()) {
    Entry<String,Object> fePropEntry=formElementPropertyIterator.next();
    if (runtimeProperties.content.containsKey(fePropEntry.getKey())) {
      if (!templateValuesRemoved) {
        formElementProperties.content=new HashMap<String,Object>(formElementProperties.content);
        templateValuesRemoved=true;
      }
      formElementProperties.content.remove(fePropEntry.getKey());
    }
  }
  removeRecordDependentProperties(runtimeProperties);
  removeRecordDependentProperties(formElementProperties);
  componentPropertyType.writeTemplateJSONContent(writer,formElementValue,forFoundsetTypedPropertyName,fe,new IModelWriter(){
    @Override public void writeComponentModel() throws JSONException {
      writer.object();
      DataConversion dataConversion=new DataConversion();
      JSONUtils.writeData(new FormElementToJSON(fe.getFlattendSolution()),writer,formElementProperties.content,formElementProperties.contentType,dataConversion,fe);
      JSONUtils.writeData(JSONUtils.FullValueToJSONConverter.INSTANCE,writer,runtimeProperties.content,runtimeProperties.contentType,dataConversion,childComponent);
      JSONUtils.writeClientConversions(writer,dataConversion);
      writer.endObject();
    }
  }
,recordBasedProperties);
  recordBasedPropertiesChanged=false;
  writeWholeViewportToJSON(writer);
  viewPortChangeMonitor.clearChanges();
  writer.endObject();
  return writer;
}

Fixed version (ground truth):
/** 
 * Writes the entire value of this property as JSON. This includes the template values, not just the runtime component properties. This is currently needed and can get called if the property is nested inside other complex properties (json object/array) that sometimes might want/need to send again the entire content.
 */
public JSONWriter fullToJSON(final JSONWriter writer,DataConversion conversionMarkers,ComponentPropertyType componentPropertyType) throws JSONException {
  if (conversionMarkers != null)   conversionMarkers.convert(ComponentPropertyType.TYPE_NAME);
  final FormElement fe=formElementValue.element;
  writer.object();
  final TypedData<Map<String,Object>> formElementProperties=fe.propertiesForTemplateJSON();
  final TypedData<Map<String,Object>> runtimeProperties=childComponent.getProperties();
  childComponent.getAndClearChanges();
  boolean templateValuesRemoved=false;
  Iterator<Entry<String,Object>> formElementPropertyIterator=formElementProperties.content.entrySet().iterator();
  while (formElementPropertyIterator.hasNext()) {
    Entry<String,Object> fePropEntry=formElementPropertyIterator.next();
    if (runtimeProperties.content.containsKey(fePropEntry.getKey())) {
      if (!templateValuesRemoved) {
        formElementProperties.content=new HashMap<String,Object>(formElementProperties.content);
        templateValuesRemoved=true;
      }
      formElementProperties.content.remove(fePropEntry.getKey());
    }
  }
  removeRecordDependentProperties(runtimeProperties);
  removeRecordDependentProperties(formElementProperties);
  final FormElementContext formElementContext=new FormElementContext(fe,null);
  componentPropertyType.writeTemplateJSONContent(writer,formElementValue,forFoundsetTypedPropertyName,formElementContext,new IModelWriter(){
    @Override public void writeComponentModel() throws JSONException {
      writer.object();
      DataConversion dataConversion=new DataConversion();
      JSONUtils.writeData(new FormElementToJSON(fe.getFlattendSolution()),writer,formElementProperties.content,formElementProperties.contentType,dataConversion,formElementContext);
      JSONUtils.writeData(JSONUtils.FullValueToJSONConverter.INSTANCE,writer,runtimeProperties.content,runtimeProperties.contentType,dataConversion,childComponent);
      JSONUtils.writeClientConversions(writer,dataConversion);
      writer.endObject();
    }
  }
,recordBasedProperties);
  recordBasedPropertiesChanged=false;
  writeWholeViewportToJSON(writer);
  viewPortChangeMonitor.clearChanges();
  writer.endObject();
  return writer;
}