You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2007/03/13 17:05:14 UTC

ListDataProvider ignores count parameter in iterate()

While porting our app to current head I noticed that one of our
developers discovered something he called a bug:

Iterator iterate(int first, int count) {
    return list.listIterator(first);
}

ignores the count parameter. It would be better/nicer to return:

list.sublist(first, count).iterator();

Now this will give different behavior to existing projects, so I
wanted to ask the list if there are any objections to changing this.

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.5 will keep your server alive. Download Wicket now!
http://wicketframework.org

Re: ListDataProvider ignores count parameter in iterate()

Posted by Igor Vaynberg <ig...@gmail.com>.
the dataview wraps the returned iterator in a bounded one that will only
call next() max (count) number of times as a safeguard for users doing a
thing just like that :) but if its really itching you then go ahead.

-igor


On 3/13/07, Martijn Dashorst <ma...@gmail.com> wrote:
>
> While porting our app to current head I noticed that one of our
> developers discovered something he called a bug:
>
> Iterator iterate(int first, int count) {
>     return list.listIterator(first);
> }
>
> ignores the count parameter. It would be better/nicer to return:
>
> list.sublist(first, count).iterator();
>
> Now this will give different behavior to existing projects, so I
> wanted to ask the list if there are any objections to changing this.
>
> Martijn
>
> --
> Learn Wicket at ApacheCon Europe: http://apachecon.com
> Join the wicket community at irc.freenode.net: ##wicket
> Wicket 1.2.5 will keep your server alive. Download Wicket now!
> http://wicketframework.org
>