Program: 14140
Project: 14140
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");
    }
    if (!jsonNode.has(name))     continue;
    JsonNode valueNode=jsonNode.get(name);
    LOG.debug("String_Node_Str" + name + "String_Node_Str"+ valueNode+ "String_Node_Str"+ valueNode.getClass());
    if (field.getType().equals(String.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,valueNode.asText());
      }
    }
 else     if (field.getType().equals(Integer.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Integer.valueOf(valueNode.asText()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.asText()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Double.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Double.valueOf(valueNode.asText()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.asText()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Boolean.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,Boolean.valueOf(valueNode.asText()));
      }
    }
 else     if (field.getType().equals(Object.class)) {
      setField(propertyDescriptorMap,field,object,new Object());
    }
 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);
  }
  Set<String> resourcePropertyNames=Sets.newHashSet(jsonNode.fieldNames());
  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;
    resourcePropertyNames.remove(name);
    JsonNode valueNode=jsonNode.get(name);
    LOG.debug("String_Node_Str" + name + "String_Node_Str"+ valueNode+ "String_Node_Str"+ valueNode.getClass());
    if (field.getType().equals(String.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,valueNode.asText());
      }
    }
 else     if (field.getType().equals(Integer.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Integer.valueOf(valueNode.asText()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.asText()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Double.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        try {
          setField(propertyDescriptorMap,field,object,Double.valueOf(valueNode.asText()));
        }
 catch (        NumberFormatException ex) {
          throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str"+ valueNode.asText()+ "String_Node_Str");
        }
      }
    }
 else     if (field.getType().equals(Boolean.class)) {
      if (!valueNode.isValueNode()) {
        throw new ValidationErrorException("String_Node_Str" + name + "String_Node_Str");
      }
 else {
        setField(propertyDescriptorMap,field,object,Boolean.valueOf(valueNode.asText()));
      }
    }
 else     if (field.getType().equals(Object.class)) {
      setField(propertyDescriptorMap,field,object,new Object());
    }
 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);
    }
  }
  if (!resourcePropertyNames.isEmpty()) {
    throw new ValidationErrorException("String_Node_Str" + resourcePropertyNames);
  }
}