String[] requiredFields = getRequiredFields();
if (!ObjectUtils.isEmpty(requiredFields)) {
Map propertyValues = new HashMap();
PropertyValue[] pvs = mpvs.getPropertyValues();
for (int i = 0; i < pvs.length; i++) {
PropertyValue pv = pvs[i];
String canonicalName = PropertyAccessorUtils.canonicalPropertyName(pv.getName());
propertyValues.put(canonicalName, pv);
}
for (int i = 0; i < requiredFields.length; i++) {
String field = requiredFields[i];
PropertyValue pv = (PropertyValue) propertyValues.get(field);
if (pv == null || pv.getValue() == null ||
(pv.getValue() instanceof String && !StringUtils.hasText((String) pv.getValue()))) {
// Use bind error processor to create FieldError.
getBindingErrorProcessor().processMissingFieldError(field, getInternalBindingResult());
// Remove property from property values to bind:
// It has already caused a field error with a rejected value.
if (pv != null) {