You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "SoulSpirit (JIRA)" <ji...@apache.org> on 2012/11/04 13:04:12 UTC

[jira] [Commented] (WICKET-4839) ConverterLocator should create a new instance for all date based converters

    [ https://issues.apache.org/jira/browse/WICKET-4839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490173#comment-13490173 ] 

SoulSpirit commented on WICKET-4839:
------------------------------------

Sorry if I'm insisting, but your solution isn't optimal: https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=7d139086fe0cd036d90fd7a32209776c1653ec5c
Your fix prevents the user to register its own converters for date related datatypes.

ConverterLocator is a registry, not a factory. The right way to register a custom converter is to call ConverterLocator#set() , which registers an *INSTANCE* of the submitted converter in a map. With your fix custom converters aren't looked up from this map, making the class buggy.

There are to solutions coming to my mind:
- synchronizing the code that makes use of DateFormat in DateConverter and other similar converters (non optimal)
- forcing the creation of a new DateFormat object each time DateConverter has to use it (a better one)

Thanks for your time.
                
> ConverterLocator should create a new instance for all date based converters
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-4839
>                 URL: https://issues.apache.org/jira/browse/WICKET-4839
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.19, 6.2.0
>            Reporter: SoulSpirit
>            Assignee: Martin Grigorov
>             Fix For: 6.3.0, 1.5.9
>
>         Attachments: quickstart.zip
>
>
> Please consider the linked issue WICKET-4833.
> I had to open a new issue because I cannot attach the quickstart project I've prepared to a closed issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira