This is about Hibernate 3.1.1, but I think this error predates that version.
In the HQL grammar definition (hql.g) the only element that differentiates a NUM_INT from a NUM_LONG is a 'l' after the number.
So 5, 6666, 777777777777 are all parsed as NUM_INT, and 777l is parsed as a NUM_LONG.
Unfortunately this behaviour is buggy: in LiteralProcessor.processNumeric the string is passed to Integer.parseInt or Long.parseLong.
Long.parseLong cannot interpret correctly a string terminated by l. From the Long.parseLong Java documentation:
"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."
This is the first bug. The second one is that a numeric string like "9999999999" generates a NumberFormatException, as it could not fit in an Integer.
I have to open a Jira ticket for both bugs, or there's something that I miss?
|