]
Emmanuel Bernard updated HHH-1386:
----------------------------------
Comment: was deleted
(was: [cheap airline
Numeric (long) literals not properly handled by HQL parser
----------------------------------------------------------
Key: HHH-1386
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1386
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.1.1
Reporter: Salvatore Insalaco
Assignee: Steve Ebersole
Priority: Minor
Fix For: 3.1.2
Attachments: LiteralProcessorPatch.txt
In the HQL grammar (hql.g) a NUM_LONG (long numeric constant) is defined as a number
followed by 'l'.
The resulting string is then passed to LiteralProcessor.processNumeric, that tries to
pass it to Long.parseLong.
Unfortunately the Long.parseLong documentation says:
"Note that neither the character L ('\u004C') nor l ('\u006C') is
permitted to appear at the end of the string as a type indicator, as would be permitted in
Java programming language source code.", and a NumberFormatException is raised.
Another issue is that a long numeric decimal without 'l' (as in
'99999999999') is not automatically coerced to a Long, and is passed to
Integer.parseInt, raising a NumberFormatException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: