[hibernate-issues] [JIRA] (HHH-13893) ConfigurationHelper can not convert value from integer to long and vice versa

Čedomir Igaly (JIRA) jira at hibernate.atlassian.net
Sat Mar 7 05:41:11 EST 2020


Čedomir Igaly ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A384b6ce1-0b6e-4b5e-976e-30a929f9f53c ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNWJkNjZiNWIwNTlkNGIwMjhjNjFmY2FmNDk4ZjIzM2QiLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-13893?atlOrigin=eyJpIjoiNWJkNjZiNWIwNTlkNGIwMjhjNjFmY2FmNDk4ZjIzM2QiLCJwIjoiaiJ9 ) HHH-13893 ( https://hibernate.atlassian.net/browse/HHH-13893?atlOrigin=eyJpIjoiNWJkNjZiNWIwNTlkNGIwMjhjNjFmY2FmNDk4ZjIzM2QiLCJwIjoiaiJ9 ) ConfigurationHelper can not convert value from integer to long and vice versa ( https://hibernate.atlassian.net/browse/HHH-13893?atlOrigin=eyJpIjoiNWJkNjZiNWIwNTlkNGIwMjhjNjFmY2FmNDk4ZjIzM2QiLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 5.4.12 Assignee: Unassigned Attachments: ConfigurationHelper.java.diff, NumberPropertyConversionTest.java Components: hibernate-core Created: 07/Mar/2020 02:41 AM Priority: Minor Reporter: Čedomir Igaly ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A384b6ce1-0b6e-4b5e-976e-30a929f9f53c )

When calling ConfigurationHelper.getLong with values map containing integer value under key 'name', it will throw ConfigurationException. Similarily, same exception is thrown if either getInt or getInteger is called with long value under key 'name'. Simple test case is attached to demonstrate this behaviour.

Suggested solution to problem above is to use longValue / intValue methods in java.lang.Number class. Suggested patch is attached.

Pull request on Github will be created.

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

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#100121- sha1:b4d24b6 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200307/d1cd7c41/attachment.html 


More information about the hibernate-issues mailing list