Here is the case for an exception @ConstraintComposition @NotBlank @Length(min = 8, max = 100) @Target( {METHOD, FIELD, PARAMETER} ) @Retention(RUNTIME) @Constraint(validatedBy = {}) public @interface PasswordConstraint { String message() default ""; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; } The problem is in the constraint validators (in this case in the org.hibernate.validator.internal.constraintvalidators.LengthValidator). Some of them handle null values and some of them don't. In this case @NotBlank constraint handles null as a value but @Length constraint doesn't so if the order of their execution is random sometimes you can get the NullPointerException (if the property is null) because of @Length constraint may be processed first. This can be fixed simpler than HV-706, generally speaking I think Option1 is not going to resolve this issue because of the eliminated groups parameter of the composing annotation. I suggest to extend the @ConstraintComposition with an order parameter, so it could be: @ConstraintComposition(order = NotBlank.class, Length.class). |