IChoiceRenderer generic type parameters are wrong throughout the AbstractChoice 
class hierarchy
-----------------------------------------------------------------------------------------------

                 Key: WICKET-2325
                 URL: https://issues.apache.org/jira/browse/WICKET-2325
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-RC5
            Reporter: Max Bowsher
            Priority: Blocker
         Attachments: choicerenderer-generics.patch

All the AbstractChoice components currently make use of an IChoiceRenderer<T>. 
They should more properly make use of an IChoiceRenderer<? super T>. The 
excessive strictness of the type parameter prevents users from defining a 
singleton choicerenderer that can be used for a variety of different choice 
components for different but related classes.

Example use-case: Most of my persistent beans implement INamedPersistentObject, 
providing getName() and getPrimaryKey() methods. This is enough to implement an 
IChoiceRenderer<INamedPersistentObject>. I wish to declare a singleton instance 
of this and reuse it for various choice components on various concrete types, 
but currently can't without messy casts.

I have set priority=blocker on this bug because it is an API issue which really 
needs consideration before 1.4 is released, as depending on how strict an 
API/ABI compatibility policy is used, it might be considered unfixable once 1.4 
is released GA.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to