BVAL-171: permit ConstraintValidator impl with compatible annotation type parameter
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/ValidatorMappingProvider.java b/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/ValidatorMappingProvider.java
index e5c7d07..e06e30e 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/ValidatorMappingProvider.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/metadata/ValidatorMappingProvider.java
@@ -38,9 +38,9 @@
final Type constraintParameter = TypeUtils.getTypeArguments(t, ConstraintValidator.class)
.get(ConstraintValidator.class.getTypeParameters()[0]);
- if (!constraintType.equals(constraintParameter)) {
+ if (!TypeUtils.isAssignable(constraintType, constraintParameter)) {
Exceptions.raise(ConstraintDefinitionException::new,
- "%s %s expected first type parameter of %s, %s; source %s", ConstraintValidator.class, t,
+ "%s %s expected first type parameter assignable from %s, %s; source %s", ConstraintValidator.class, t,
constraintType, constraintParameter, result.get().getSource());
}
}