[seam-issues] [JBoss JIRA] Assigned: (JBSEAM-4087) Regexp Query.SUBJECT_PATTERN may be improved for JBSEAM-3032

Marek Novotny (JIRA) jira-events at lists.jboss.org
Wed Jan 20 11:43:47 EST 2010


     [ https://jira.jboss.org/jira/browse/JBSEAM-4087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marek Novotny reassigned JBSEAM-4087:
-------------------------------------

    Assignee: Marek Novotny


> Regexp Query.SUBJECT_PATTERN may be improved for JBSEAM-3032
> ------------------------------------------------------------
>
>                 Key: JBSEAM-4087
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4087
>             Project: Seam
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.1.2.CR1
>         Environment: https://jira.jboss.org/jira/browse/JBSEAM-3032
> http://fisheye.jboss.org/browse/Seam/trunk/src/main/org/jboss/seam/framework/Query.java?r=10341
>            Reporter: Julien Kronegg
>            Assignee: Marek Novotny
>            Priority: Minor
>             Fix For: 2.2.1.CR1
>
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> The regexp Pattern Query.SUBJECT_PATTERN has been added for JBSEAM-3032:
>     private static final Pattern SUBJECT_PATTERN = Pattern.compile("^select (\\w+((\\s+|\\.)\\w+)*)\\s+from", Pattern.CASE_INSENSITIVE);
> This pattern should be improved because it will not match queries such as:
>     select       vehicle1.person     from Vehicle vehicle1
>     select       vehicle2.person, vehicle2.color    from Vehicle vehicle2
>     select       vehicle3.person      from Vehicle vehicle3 where vehicle3.id in (select c.id from Cars c)
>     select vehicle4 . person  from Vehicle vehicle4
> The following pattern will accept all of the above queries:
>     Pattern.compile("^select\\s+(\\w+(?:\\s*\\.\\s*\\w+)*?)(?:\\s*,\\s*(\\w+(?:\\s*\\.\\s*\\w+)*?))*?\\s+from", Pattern.CASE_INSENSITIVE);
> The test case http://fisheye.jboss.org/browse/Seam/trunk/src/test/unit/org/jboss/seam/test/unit/QueryTest.java?r=10260 should also be completed by the queries above.
> Notes:
>   - the priority has been set the same JBSEAM-3032
>   - the original pattern matches in about 300 ns while the proposed pattern matches in 2300 ns

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

        


More information about the seam-issues mailing list