[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-689) Seam framework Query too sensitive about keyword case

Leo Baschy (JIRA) jira-events at jboss.com
Wed Jan 24 21:04:52 EST 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-689?page=comments#action_12351589 ] 
            
Leo Baschy commented on JBSEAM-689:
-----------------------------------

The regular expressions in the attached patch covers way more cases than the original indexOf, possibly all cases that real programmers will write in the next five years.

For complete correctness though, EJBQL identifiers are defined in section 4.4.1 Identifiers of JSR 220: Enterprise JavaBeans, Version 3.0 Java Persistence API.

As one can recognize, for perfection one probably should use Character.isJavaIdentifierPart() and related methods to check the characters before and after the keyword (i.e. "from" or "order").  Still should use case insensitive regular expression for the keyword itself.  Complete correctness may be complex to figure out and complex to test.

> Seam framework Query too sensitive about keyword case
> -----------------------------------------------------
>
>                 Key: JBSEAM-689
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-689
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 1.1.1.GA
>            Reporter: Leo Baschy
>         Assigned To: Gavin King
>             Fix For: 1.1.5.GA
>
>         Attachments: Query.java.patch
>
>
> When the org.jboss.seam.framework.Query uses anything but lower case "from" and "order" then in Query method getCountEjbql calls to indexOf return -1, which then causes an exception when calling substring.
> Further, indexOf("from") and indexOf("order") also would match e.g. fromAddress or orderNumber, which would be wrong.
> Upper case or any case "FROM" and "ORDER" should be tolerated.  Names that happen to contain letter sequences "from" or "order" should be ignored.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list