Skip to content

Commit 6187951

Browse files
marko-bekhtagsmet
authored andcommitted
HV-1363 Remove redundant check in ConfiguredConstraint
- based on the usage of the method we cannot receive methods into it, hence the check can be removed. And also the method can be named more specific to represent what it is really should be doing.
1 parent 3b36f2f commit 6187951

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

engine/src/main/java/org/hibernate/validator/internal/cfg/context/ConfiguredConstraint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ static <A extends Annotation> ConfiguredConstraint<A> forType(ConstraintDef<?, A
5656
return new ConfiguredConstraint<>( constraint, ConstraintLocation.forClass( beanType ), ElementType.TYPE );
5757
}
5858

59-
static <A extends Annotation> ConfiguredConstraint<A> forProperty(ConstraintDef<?, A> constraint, Property property) {
59+
static <A extends Annotation> ConfiguredConstraint<A> forFieldProperty(ConstraintDef<?, A> constraint, Property property) {
6060
return new ConfiguredConstraint<>(
6161
constraint,
6262
ConstraintLocation.forProperty( property ),
63-
property instanceof JavaBeanField ? ElementType.FIELD : ElementType.METHOD
63+
ElementType.FIELD
6464
);
6565
}
6666

engine/src/main/java/org/hibernate/validator/internal/cfg/context/PropertyConstraintMappingContextImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected PropertyConstraintMappingContextImpl getThis() {
5959
public PropertyConstraintMappingContext constraint(ConstraintDef<?, ?> definition) {
6060
if ( property instanceof JavaBeanField ) {
6161
super.addConstraint(
62-
ConfiguredConstraint.forProperty(
62+
ConfiguredConstraint.forFieldProperty(
6363
definition, property
6464
)
6565
);

0 commit comments

Comments
 (0)