Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9de0151

Browse files
committed
avoid use of == in ArrayAndElementArgumentValidator
1 parent 1207a39 commit 9de0151

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
@@ -39,7 +39,9 @@ public void validate(
3939
final SqmTypedNode<?> elementArgument = arguments.get( elementIndex );
4040
final SqmBindableType<?> expressible = elementArgument.getExpressible();
4141
final SqmExpressible<?> elementType = expressible != null ? expressible.getSqmType() : null;
42-
if ( expectedElementType != null && elementType != null && expectedElementType != elementType ) {
42+
if ( expectedElementType != null && elementType != null
43+
&& !expectedElementType.getJavaType()
44+
.isAssignableFrom( elementType.getExpressibleJavaType().getJavaTypeClass() ) ) {
4345
throw new FunctionArgumentException(
4446
String.format(
4547
"Parameter %d of function '%s()' has type %s, but argument is of type '%s'",

0 commit comments

Comments
 (0)