Skip to content
Permalink
Browse files
correctly handle IMPLICIT constraintTarget
  • Loading branch information
mbenson committed Oct 16, 2018
1 parent 54dab69 commit 963ac52b122dfa55bd71fa36dbc420629455a836
Showing 1 changed file with 3 additions and 3 deletions.
@@ -240,7 +240,7 @@ private Set<Class<? extends Payload>> computePayload() {

private ConstraintTarget computeValidationAppliesTo(ElementType elementType) {
final ConstraintTarget result = read(ConstraintAnnotationAttributes.VALIDATION_APPLIES_TO);
if (result != null) {
if (result != null && result != ConstraintTarget.IMPLICIT) {
final AnnotatedElement host = meta.getHost();
Exceptions.raiseUnless(host instanceof Executable, ConstraintDeclarationException::new, "Illegal %s on %s",
result, host);
@@ -254,9 +254,9 @@ private ConstraintTarget computeValidationAppliesTo(ElementType elementType) {
Exceptions.raiseIf(Void.TYPE.equals(meta.getType()), ConstraintDeclarationException::new,
"Illegal %s on %s method %s", result, Void.TYPE, host);
break;
case IMPLICIT:
// handled in ReflectionBuilder
default:
Exceptions.raise(IllegalStateException::new, "Unknown %s %s", ConstraintTarget.class.getSimpleName(),
result);
}
}
return result;

0 comments on commit 963ac52

Please sign in to comment.