Map<Type, Type> resolvedTypes = new HashMap<Type, Type>();
Type constraintValidatorType = resolveTypes(resolvedTypes, validator);
Type validatorType = ((ParameterizedType) constraintValidatorType)
.getActualTypeArguments()[VALIDATOR_TYPE_INDEX];
if (validatorType == null) {
throw new ValidationException("null is an invalid type for a ConstraintValidator");
} else if (validatorType instanceof GenericArrayType) {
validatorType = getArrayType(getComponentType(validatorType));
}
while (resolvedTypes.containsKey(validatorType)) {
validatorType = resolvedTypes.get(validatorType);