Author: hardy.ferentschik
Date: 2009-06-18 13:18:35 -0400 (Thu, 18 Jun 2009)
New Revision: 16839
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
Log:
Made sure null instance returned from validator factory throws ValidationException
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-06-18
17:17:48 UTC (rev 16838)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-06-18
17:18:35 UTC (rev 16839)
@@ -180,6 +180,11 @@
constraintValidator = ( ConstraintValidator<A, V> )
constraintFactory.getInstance(
validatorClass
);
+ if ( constraintValidator == null ) {
+ throw new ValidationException(
+ "Constraint factory returned null when trying to create instance of " +
validatorClass.getName()
+ );
+ }
constraintValidatorCache.put( validatorClass, constraintValidator );
}
else {
Show replies by date