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

Johannes Schneider commented on WICKET-1512:
--------------------------------------------

You are right: Having two types is very, very annoying. I suggest to avoid that 
(I just created that patch - didn't apply it at my local code base - nobody 
wants to apply it ;-).

I just wanted to start a discussion about that. I think it *is* possible to 
return an iterator of foo while the getModel() method returns a model 
containing bar.
I don't know if that is a misuse or not. But if you decide to add only *one* 
parameter, you should know that you might break some code...


About the widening: I will create a sample that shows the problem...

> Widen Generics for Lists/Iteratos
> ---------------------------------
>
>                 Key: WICKET-1512
>                 URL: https://issues.apache.org/jira/browse/WICKET-1512
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-M1
>            Reporter: Johannes Schneider
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-M1
>
>         Attachments: two_parameters.patch, 
> Widening_Generics_for_IDataProvider.patch
>
>
> It is important to widen the generics for collections.
> For example it is better (and sometimes necessary) to change the signature of 
>  org.apache.wicket.markup.repeater.data.IDataProvider#iterator to:
> Iterator<? extends T> iterator(int first, int count);
> I will create and add a patch later.

-- 
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