Skip to content

Commit a7f6197

Browse files
committed
HHH-19276 - Avoid use of == in ArrayAndElementArgumentValidator
1 parent c039138 commit a7f6197

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/function/array/ArrayAndElementArgumentValidator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public void validate(
3636
final var elementArgument = arguments.get( elementIndex );
3737
final var expressible = elementArgument.getExpressible();
3838
final var elementType = expressible != null ? expressible.getSqmType() : null;
39-
if ( expectedElementType != null && elementType != null && expectedElementType != elementType ) {
39+
if ( expectedElementType != null && elementType != null
40+
&& !expectedElementType.getJavaType()
41+
.isAssignableFrom( elementType.getExpressibleJavaType().getJavaTypeClass() ) ) {
4042
throw new FunctionArgumentException(
4143
String.format(
4244
"Parameter %d of function '%s()' has type %s, but argument is of type '%s'",

0 commit comments

Comments
 (0)