You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Anita Anandan <an...@oracle.com> on 2008/08/29 04:45:00 UTC

DateTimeConverter's patterns

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

Re: DateTimeConverter's patterns

Posted by Matthias Wessendorf <ma...@apache.org>.
On Fri, Aug 29, 2008 at 4:45 AM, Anita Anandan <an...@oracle.com> wrote:
> 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.
on the server we should keep the ordering as well, yes.
>
> (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.

if it would honor the locales, that would be great.

If you provide a patch, please don't use the TRINIDAD-859 ticket.
I'd suggest to create a new one.

>
> Any feedback would be useful.
>
> Thanks
> Anita
>



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org