]
Samuel Mendenhall reassigned JBSEAM-4087:
-----------------------------------------
Assignee: Samuel Mendenhall (was: 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/framew...
Reporter: Julien Kronegg
Assignee: Samuel Mendenhall
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/t...
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: