Program: 33085
Project: 33085
Buggy source:
/** 
 * Writes bean description recursively.
 * @param jgen to write to
 * @param currentVocab in context
 * @param valueType class of value
 * @param allRootParameters of the method that receives the request body
 * @param rootParameter the request body
 * @param currentCallValue the value at the current recursion level
 * @param propertyPath of the current recursion level
 * @throws IntrospectionException
 * @throws IOException
 */
private void recurseSupportedProperties(JsonGenerator jgen,String currentVocab,Class<?> valueType,AnnotatedParameters allRootParameters,AnnotatedParameter rootParameter,Object currentCallValue,String propertyPath) throws IntrospectionException, IOException {
  Map<String,AnnotatedParameter> properties=new HashMap<String,AnnotatedParameter>();
  Constructor[] constructors=valueType.getConstructors();
  Constructor constructor=PropertyUtils.findDefaultCtor(constructors);
  if (constructor == null) {
    constructor=PropertyUtils.findJsonCreator(constructors,JsonCreator.class);
  }
  Assert.notNull(constructor,"String_Node_Str" + valueType.getName());
  int parameterCount=constructor.getParameterTypes().length;
  if (parameterCount > 0) {
    Annotation[][] annotationsOnParameters=constructor.getParameterAnnotations();
    Class[] parameters=constructor.getParameterTypes();
    int paramIndex=0;
    for (    Annotation[] annotationsOnParameter : annotationsOnParameters) {
      for (      Annotation annotation : annotationsOnParameter) {
        if (JsonProperty.class == annotation.annotationType()) {
          JsonProperty jsonProperty=(JsonProperty)annotation;
          String paramName=jsonProperty.value();
          Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,paramName);
          AnnotatedParameter constructorParamInputParameter=new ActionInputParameter(new MethodParameter(constructor,paramIndex),propertyValue);
          properties.put(paramName,constructorParamInputParameter);
          paramIndex++;
        }
      }
    }
    Assert.isTrue(parameters.length == paramIndex,"String_Node_Str" + constructor.getName() + "String_Node_Str");
  }
  final BeanInfo beanInfo=Introspector.getBeanInfo(valueType);
  final PropertyDescriptor[] propertyDescriptors=beanInfo.getPropertyDescriptors();
  for (  PropertyDescriptor propertyDescriptor : propertyDescriptors) {
    final Method writeMethod=propertyDescriptor.getWriteMethod();
    if (writeMethod == null) {
      continue;
    }
    String propertyName=getWritableExposedPropertyOrPropertyName(propertyDescriptor);
    Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,propertyDescriptor.getName());
    MethodParameter methodParameter=new MethodParameter(propertyDescriptor.getWriteMethod(),0);
    AnnotatedParameter propertySetterInputParameter=new ActionInputParameter(methodParameter,propertyValue);
    properties.put(propertyName,propertySetterInputParameter);
  }
  for (  AnnotatedParameter annotatedParameter : properties.values()) {
    String nextPropertyPathLevel=propertyPath.isEmpty() ? annotatedParameter.getParameterName() : propertyPath + '.' + annotatedParameter.getParameterName();
    if (DataType.isSingleValueType(annotatedParameter.getParameterType())) {
      final Object[] possiblePropertyValues=rootParameter.getPossibleValues(allRootParameters);
      if (rootParameter.isIncluded(nextPropertyPathLevel) && !rootParameter.isExcluded(nextPropertyPathLevel)) {
        writeSupportedProperty(jgen,currentVocab,annotatedParameter,annotatedParameter.getParameterName(),possiblePropertyValues);
      }
    }
 else {
      jgen.writeStartObject();
      jgen.writeStringField("String_Node_Str",annotatedParameter.getParameterName());
      jgen.writeObjectFieldStart(getPropertyOrClassNameInVocab(currentVocab,"String_Node_Str",LdContextFactory.HTTP_SCHEMA_ORG,"String_Node_Str"));
      Expose expose=AnnotationUtils.getAnnotation(annotatedParameter.getParameterType(),Expose.class);
      String subClass;
      if (expose != null) {
        subClass=expose.value();
      }
 else {
        subClass=annotatedParameter.getParameterType().getSimpleName();
      }
      jgen.writeStringField(getPropertyOrClassNameInVocab(currentVocab,"String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str"),subClass);
      jgen.writeArrayFieldStart("String_Node_Str");
      Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,annotatedParameter.getParameterName());
      recurseSupportedProperties(jgen,currentVocab,annotatedParameter.getParameterType(),allRootParameters,rootParameter,propertyValue,nextPropertyPathLevel);
      jgen.writeEndArray();
      jgen.writeEndObject();
      jgen.writeEndObject();
    }
  }
}

Fixed version (ground truth):
/** 
 * Writes bean description recursively.
 * @param jgen to write to
 * @param currentVocab in context
 * @param valueType class of value
 * @param allRootParameters of the method that receives the request body
 * @param rootParameter the request body
 * @param currentCallValue the value at the current recursion level
 * @param propertyPath of the current recursion level
 * @throws IntrospectionException
 * @throws IOException
 */
private void recurseSupportedProperties(JsonGenerator jgen,String currentVocab,Class<?> valueType,ActionDescriptor allRootParameters,ActionInputParameter rootParameter,Object currentCallValue,String propertyPath) throws IntrospectionException, IOException {
  Map<String,ActionInputParameter> properties=new HashMap<String,ActionInputParameter>();
  Constructor[] constructors=valueType.getConstructors();
  Constructor constructor=PropertyUtils.findDefaultCtor(constructors);
  if (constructor == null) {
    constructor=PropertyUtils.findJsonCreator(constructors,JsonCreator.class);
  }
  Assert.notNull(constructor,"String_Node_Str" + valueType.getName());
  int parameterCount=constructor.getParameterTypes().length;
  if (parameterCount > 0) {
    Annotation[][] annotationsOnParameters=constructor.getParameterAnnotations();
    Class[] parameters=constructor.getParameterTypes();
    int paramIndex=0;
    for (    Annotation[] annotationsOnParameter : annotationsOnParameters) {
      for (      Annotation annotation : annotationsOnParameter) {
        if (JsonProperty.class == annotation.annotationType()) {
          JsonProperty jsonProperty=(JsonProperty)annotation;
          String paramName=jsonProperty.value();
          Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,paramName);
          ActionInputParameter constructorParamInputParameter=new SpringActionInputParameter(new MethodParameter(constructor,paramIndex),propertyValue);
          properties.put(paramName,constructorParamInputParameter);
          paramIndex++;
        }
      }
    }
    Assert.isTrue(parameters.length == paramIndex,"String_Node_Str" + constructor.getName() + "String_Node_Str");
  }
  final BeanInfo beanInfo=Introspector.getBeanInfo(valueType);
  final PropertyDescriptor[] propertyDescriptors=beanInfo.getPropertyDescriptors();
  for (  PropertyDescriptor propertyDescriptor : propertyDescriptors) {
    final Method writeMethod=propertyDescriptor.getWriteMethod();
    if (writeMethod == null) {
      continue;
    }
    String propertyName=getWritableExposedPropertyOrPropertyName(propertyDescriptor);
    Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,propertyDescriptor.getName());
    MethodParameter methodParameter=new MethodParameter(propertyDescriptor.getWriteMethod(),0);
    ActionInputParameter propertySetterInputParameter=new SpringActionInputParameter(methodParameter,propertyValue);
    properties.put(propertyName,propertySetterInputParameter);
  }
  for (  ActionInputParameter annotatedParameter : properties.values()) {
    String nextPropertyPathLevel=propertyPath.isEmpty() ? annotatedParameter.getParameterName() : propertyPath + '.' + annotatedParameter.getParameterName();
    if (DataType.isSingleValueType(annotatedParameter.getParameterType())) {
      final Object[] possiblePropertyValues=rootParameter.getPossibleValues(allRootParameters);
      if (rootParameter.isIncluded(nextPropertyPathLevel) && !rootParameter.isExcluded(nextPropertyPathLevel)) {
        writeSupportedProperty(jgen,currentVocab,annotatedParameter,annotatedParameter.getParameterName(),possiblePropertyValues);
      }
    }
 else {
      jgen.writeStartObject();
      jgen.writeStringField("String_Node_Str",annotatedParameter.getParameterName());
      jgen.writeObjectFieldStart(getPropertyOrClassNameInVocab(currentVocab,"String_Node_Str",LdContextFactory.HTTP_SCHEMA_ORG,"String_Node_Str"));
      Expose expose=AnnotationUtils.getAnnotation(annotatedParameter.getParameterType(),Expose.class);
      String subClass;
      if (expose != null) {
        subClass=expose.value();
      }
 else {
        subClass=annotatedParameter.getParameterType().getSimpleName();
      }
      jgen.writeStringField(getPropertyOrClassNameInVocab(currentVocab,"String_Node_Str","String_Node_Str" + "String_Node_Str","String_Node_Str"),subClass);
      jgen.writeArrayFieldStart("String_Node_Str");
      Object propertyValue=PropertyUtils.getPropertyOrFieldValue(currentCallValue,annotatedParameter.getParameterName());
      recurseSupportedProperties(jgen,currentVocab,annotatedParameter.getParameterType(),allRootParameters,rootParameter,propertyValue,nextPropertyPathLevel);
      jgen.writeEndArray();
      jgen.writeEndObject();
      jgen.writeEndObject();
    }
  }
}