Exclude legacy @⁠javax.validation.Constraint from attribute override check

Prior to this commit, we only excluded @⁠jakarta.validation.Constraint
from the convention-based annotation attribute override check.

This commit additionally excludes the legacy
@⁠javax.validation.Constraint annotation from the convention-based
annotation attribute override check.

See gh-28760
See gh-28761
Closes gh-36412
This commit is contained in:
Sam Brannen
2026-03-03 17:02:13 +01:00
parent 2bbea84830
commit 0a933787a6
@@ -53,8 +53,10 @@ final class AnnotationTypeMapping {
private static final Log logger = LogFactory.getLog(AnnotationTypeMapping.class);
private static final Predicate<? super Annotation> isBeanValidationConstraint = annotation ->
annotation.annotationType().getName().equals("jakarta.validation.Constraint");
private static final Predicate<? super Annotation> isBeanValidationConstraint = annotation -> {
String name = annotation.annotationType().getName();
return (name.equals("jakarta.validation.Constraint") || name.equals("javax.validation.Constraint"));
};
/**
* Set used to track which convention-based annotation attribute overrides