[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1386) Numeric (long) literals not properly handled by HQL parser

Razan Abbass (JIRA) noreply at atlassian.com
Sun Oct 10 18:52:58 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38674#action_38674 ] 

Razan Abbass commented on HHH-1386:
-----------------------------------

[cheap airline tickets|http://getflightsto.com]
[Parenting|http://childcareforums.com]


> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list