Incorrect PRE_PROCESS_PATTERN in DateTypeConverter.java
-------------------------------------------------------

                 Key: STS-650
                 URL: http://www.stripesframework.org/jira/browse/STS-650
             Project: Stripes
          Issue Type: Bug
          Components: Formatting, Validation
    Affects Versions: Release 1.5
            Reporter: Ben Gunter
            Priority: Minor
             Fix For: Release 1.5.1, Release 1.6


>From the users mailing list ...

In DateTypeConverter.java I see this:

public static final Pattern PRE_PROCESS_PATTERN =
Pattern.compile("(?<!GMT)[\\s,-/\\.]+");

That RE is almost certainly incorrect.  The '-' in the character class
is acting as a character range metacharacter, not a bare hyphen.  As it
happens, in ASCII the range between ',' and '/' is ',' '-' '.' '/', all
of which appear elsewhere in the character class, so it works by
accident - at least for ASCII.

The correct RE is "(?<!GMT)[\\s,/\\.-]+"  Putting the '-' as the last
character means it is treated as a hyphen, not a character range
metacharacter.

--
Alan Burlison
--

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

        

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to