|
21 | 21 | import org.hibernate.validator.cfg.ConstraintDef;
|
22 | 22 | import org.hibernate.validator.internal.metadata.location.ConstraintLocation;
|
23 | 23 | import org.hibernate.validator.internal.properties.Callable;
|
24 |
| -import org.hibernate.validator.internal.properties.Property; |
25 | 24 | import org.hibernate.validator.internal.properties.javabean.JavaBeanField;
|
26 |
| -import org.hibernate.validator.internal.properties.javabean.JavaBeanGetter; |
27 | 25 | import org.hibernate.validator.internal.util.annotation.AnnotationDescriptor;
|
28 | 26 | import org.hibernate.validator.internal.util.annotation.ConstraintAnnotationDescriptor;
|
29 | 27 | import org.hibernate.validator.internal.util.logging.Log;
|
@@ -57,13 +55,11 @@ static <A extends Annotation> ConfiguredConstraint<A> forType(ConstraintDef<?, A
|
57 | 55 | return new ConfiguredConstraint<>( constraint, ConstraintLocation.forClass( beanType ), ElementType.TYPE );
|
58 | 56 | }
|
59 | 57 |
|
60 |
| - static <A extends Annotation> ConfiguredConstraint<A> forProperty(ConstraintDef<?, A> constraint, Property property) { |
| 58 | + static <A extends Annotation> ConfiguredConstraint<A> forFieldProperty(ConstraintDef<?, A> constraint, JavaBeanField javaBeanField) { |
61 | 59 | return new ConfiguredConstraint<>(
|
62 | 60 | constraint,
|
63 |
| - property instanceof JavaBeanField |
64 |
| - ? ConstraintLocation.forField( property.as( JavaBeanField.class ) ) |
65 |
| - : ConstraintLocation.forGetter( property.as( JavaBeanGetter.class ) ), |
66 |
| - property instanceof JavaBeanField ? ElementType.FIELD : ElementType.METHOD |
| 61 | + ConstraintLocation.forField( javaBeanField ), |
| 62 | + ElementType.FIELD |
67 | 63 | );
|
68 | 64 | }
|
69 | 65 |
|
|
0 commit comments