Program: 14245
Project: 14245
Buggy source:
public static void populateResourceProperties(Object object,JsonNode jsonNode) throws CloudFormationException {
  if (jsonNode == null)   return;
  BeanInfo beanInfo=null;
  try {
    beanInfo=Introspector.getBeanInfo(object.getClass());
  }
 catch (  IntrospectionException ex) {
    LOG.error("String_Node_Str" + object.getClass().getCanonicalName() + "String_Node_Str");
    throw new InternalFailureException(ex.getMessage());
  }
  Map<String,PropertyDescriptor> propertyDescriptorMap=Maps.newHashMap();
  for (  PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
    propertyDescriptorMap.put(propertyDescriptor.getName(),propertyDescriptor);
  }
  for (  Field field : object.getClass().getDeclaredFields()) {
    Property property=field.getAnnotation(Property.class);
    if (property == null)     continue;
    String defaultName=field.getName().substring(0,1).toUpperCase() + field.getName().substring(1);
    String name=(property.name() == null || property.name().isEmpty() ? defaultName : property.name());
    Required required=field.getAnnotation(Required.class);
    if (required != null && !jsonNode.has(name)) {
      throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
    }
    JsonNode valueNode=jsonNode.get(name);
    if (field.getType().equals(String.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,valueNode.textValue());
      }
    }
 else     if (field.getType().equals(Integer.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Integer.valueOf(valueNode.textValue()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.textValue()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Double.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Double.valueOf(valueNode.textValue()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.textValue()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Boolean.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,Boolean.valueOf(valueNode.textValue()));
      }
    }
 else     if (JsonNode.class.isAssignableFrom(field.getType())) {
      setField(propertyDescriptorMap,field,object,valueNode);
    }
 else     if (Collection.class.isAssignableFrom(field.getType())) {
      Type genericFieldType=field.getGenericType();
      if (genericFieldType instanceof ParameterizedType) {
        if (!valueNode.isArray()) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
        }
        Type collectionType=((ParameterizedType)genericFieldType).getActualTypeArguments()[0];
        if (getField(propertyDescriptorMap,field,object) == null) {
          LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
          throw new InternalFailureException("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
        populateList((Collection<?>)getField(propertyDescriptorMap,field,object),valueNode,collectionType,field.getName());
      }
 else {
        LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
        throw new InternalFailureException("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
      }
    }
 else {
      if (getField(propertyDescriptorMap,field,object) == null) {
        try {
          setField(propertyDescriptorMap,field,object,field.getType().newInstance());
        }
 catch (        IllegalAccessException|InstantiationException ex) {
          LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str");
          throw new InternalFailureException(ex.getMessage());
        }
      }
      populateResourceProperties(getField(propertyDescriptorMap,field,object),valueNode);
    }
  }
}

Fixed version (ground truth):
public static void populateResourceProperties(Object object,JsonNode jsonNode) throws CloudFormationException {
  if (jsonNode == null)   return;
  BeanInfo beanInfo=null;
  try {
    beanInfo=Introspector.getBeanInfo(object.getClass());
  }
 catch (  IntrospectionException ex) {
    LOG.error("String_Node_Str" + object.getClass().getCanonicalName() + "String_Node_Str");
    throw new InternalFailureException(ex.getMessage());
  }
  Map<String,PropertyDescriptor> propertyDescriptorMap=Maps.newHashMap();
  for (  PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
    propertyDescriptorMap.put(propertyDescriptor.getName(),propertyDescriptor);
  }
  for (  Field field : object.getClass().getDeclaredFields()) {
    Property property=field.getAnnotation(Property.class);
    if (property == null)     continue;
    String defaultName=field.getName().substring(0,1).toUpperCase() + field.getName().substring(1);
    String name=(property.name() == null || property.name().isEmpty() ? defaultName : property.name());
    Required required=field.getAnnotation(Required.class);
    if (required != null && !jsonNode.has(name)) {
      throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
    }
    if (!jsonNode.has(name))     continue;
    JsonNode valueNode=jsonNode.get(name);
    if (field.getType().equals(String.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,valueNode.textValue());
      }
    }
 else     if (field.getType().equals(Integer.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Integer.valueOf(valueNode.textValue()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.textValue()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Double.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Double.valueOf(valueNode.textValue()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.textValue()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Boolean.class)) {
      if (!valueNode.isTextual()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,Boolean.valueOf(valueNode.textValue()));
      }
    }
 else     if (JsonNode.class.isAssignableFrom(field.getType())) {
      setField(propertyDescriptorMap,field,object,valueNode);
    }
 else     if (Collection.class.isAssignableFrom(field.getType())) {
      Type genericFieldType=field.getGenericType();
      if (genericFieldType instanceof ParameterizedType) {
        if (!valueNode.isArray()) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
        }
        Type collectionType=((ParameterizedType)genericFieldType).getActualTypeArguments()[0];
        if (getField(propertyDescriptorMap,field,object) == null) {
          LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
          throw new InternalFailureException("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
        populateList((Collection<?>)getField(propertyDescriptorMap,field,object),valueNode,collectionType,field.getName());
      }
 else {
        LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
        throw new InternalFailureException("String_Node_Str" + object.getClass() + "String_Node_Str"+ field.getName()+ "String_Node_Str"+ "String_Node_Str");
      }
    }
 else {
      if (getField(propertyDescriptorMap,field,object) == null) {
        try {
          setField(propertyDescriptorMap,field,object,field.getType().newInstance());
        }
 catch (        IllegalAccessException|InstantiationException ex) {
          LOG.error("String_Node_Str" + object.getClass() + "String_Node_Str");
          throw new InternalFailureException(ex.getMessage());
        }
      }
      populateResourceProperties(getField(propertyDescriptorMap,field,object),valueNode);
    }
  }
}