Stripes

Incorrect PRE_PROCESS_PATTERN in DateTypeConverter.java

Details

Description

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

Activity

Hide
Ben Gunter added a comment - 26/Feb/09 3:59 PM

Fixed as suggested

Show
Ben Gunter added a comment - 26/Feb/09 3:59 PM Fixed as suggested

People

Vote (0)
Watch (0)

Dates

  • Created:
    25/Feb/09 8:53 AM
    Updated:
    04/Jan/11 2:38 PM
    Resolved:
    26/Feb/09 3:59 PM