[hibernate-issues] [JIRA] (HHH-13932) Trying to set an unused parameter causes a NullPointerException, instread of throwing a more sensible error.

Kyle Condon (JIRA) jira at hibernate.atlassian.net
Mon Apr 6 06:23:42 EDT 2020


Kyle Condon ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e84a8c7c8077c0c1f09920f ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13932?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 ) HHH-13932 ( https://hibernate.atlassian.net/browse/HHH-13932?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 ) Trying to set an unused parameter causes a NullPointerException, instread of throwing a more sensible error. ( https://hibernate.atlassian.net/browse/HHH-13932?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.2.11 Assignee: Unassigned Components: hibernate-core Created: 06/Apr/2020 03:23 AM Environment: JDK8, MySQL 5.7 Priority: Minor Reporter: Kyle Condon ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e84a8c7c8077c0c1f09920f )

Supposing a ParameterExpression is defined and then subsequently not used in a query, for example due to an application setting, when the user attempts to set this parameter using Query::setParameter a nullpointer exception is thrown.

This is due to CriteriaQueryTypeQueryAdapter::explicitParameterInfoMap not having a key for the parameter, as it was never used in the query to begin with.

Either this should throw an explicit runtime exception, if this behavior is indeed meant to be disallowed or silently do nothing, as the parameter is not in the query to begin with.

Apologies if this has been fixed in a newer version.

( https://hibernate.atlassian.net/browse/HHH-13932#add-comment?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13932#add-comment?atlOrigin=eyJpIjoiZjMyNjg5MmNkZmEzNGY5MTliYjc5MWE2OTE0MGNmMmQiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100124- sha1:c7667cc )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200406/0c81cb5d/attachment.html 


More information about the hibernate-issues mailing list