myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anita Anandan <anita.anan...@oracle.com>
Subject DateTimeConverter's patterns
Date Fri, 29 Aug 2008 02:45:00 GMT
I had a couple questions on 
org.apache.myfaces.trinidad.convert.DateTimeConverter._doLenientParse().

This method creates a set of patterns to match against the user provided 
input string. Of course, we start with the format associated with the 
current locale. But to make our converter more friendly, we also try 
with 3 other patterns for convenience (TRINIDAD-859).

(a) The patterns variable is of type HashSet. Set (and its 
implementation HashSet) do not provide any guarantee of iteration. Do we 
not care about the order in which we try to make matches? Note that in 
the client validation code, we use an array which imposes an order.

(b) Also, the 3 static strings do not take into consideration the 
locale. So for e.g. no matter if the locale is en_us (USA) or en 
(Europe) the first static pattern is MM dd yy. This seems confusing.

Any feedback would be useful.

Thanks
Anita

Mime
View raw message