Skip to content

Commit 720d4bd

Browse files
committed
Fix potential CCE due to casting the wrong object after instanceof check
1 parent e6ff3ca commit 720d4bd

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
@@ -685,9 +685,8 @@ private static <T> JdbcMapping jdbcMapping(QueryParameterBinding<T> domainParamB
685685
if ( domainParamBinding.getType() instanceof JdbcMapping mapping ) {
686686
return mapping;
687687
}
688-
// TODO: why do the test and the cast disagree here? getBindType() vs getType()
689688
else if ( domainParamBinding.getBindType() instanceof BasicValuedMapping ) {
690-
return ( (BasicValuedMapping) domainParamBinding.getType() ).getJdbcMapping();
689+
return ( (BasicValuedMapping) domainParamBinding.getBindType() ).getJdbcMapping();
691690
}
692691
else {
693692
return null;

0 commit comments

Comments
 (0)