[ http://issues.apache.org/jira/browse/TAPESTRY-272?page=all ]

Jesse Kuhnert resolved TAPESTRY-272.
------------------------------------

    Fix Version/s: 4.0
       Resolution: Fixed

> Improve DateValidator Concurrency
> ---------------------------------
>
>                 Key: TAPESTRY-272
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-272
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 3.0.2
>         Environment: All
>            Reporter: Hanson Char
>            Priority: Minor
>             Fix For: 4.0
>
>
> A suggestion on speeding up the DateValidator in method toObject():
> Instead of
> ...
>       DateFormat format = getEffectiveFormat();
>        Date result;
>        try
>        {
>            // DateFormat is not threadsafe, so guard access
>            // to it.
>            synchronized (format)
>            {
>                result = format.parse(value);
>            }
> ...
> Why not:
>                DateFormat format = (DateFormat)getEffectiveFormat().clone();
>                Date result;
>                try
>                {
>                        result = format.parse(value);
> This makes it thread-safe without synchronization.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to