Skip to content

Commit 6636374

Browse files
committed
Fix potential CCE due to casting the wrong object after instanceof check
1 parent ce562b7 commit 6636374

File tree

1 file changed

+1
-2
lines changed
  • hibernate-core/src/main/java/org/hibernate/query/sqm/internal

1 file changed

+1
-2
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,8 @@ private static <T> JdbcMapping jdbcMapping(QueryParameterBinding<T> domainParamB
690690
if ( domainParamBinding.getType() instanceof JdbcMapping mapping ) {
691691
return mapping;
692692
}
693-
// TODO: why do the test and the cast disagree here? getBindType() vs getType()
694693
else if ( domainParamBinding.getBindType() instanceof BasicValuedMapping ) {
695-
return ( (BasicValuedMapping) domainParamBinding.getType() ).getJdbcMapping();
694+
return ( (BasicValuedMapping) domainParamBinding.getBindType() ).getJdbcMapping();
696695
}
697696
else {
698697
return null;

0 commit comments

Comments
 (0)