Ah, yes... interesting. Maybe it /is/ better to return null or a new ArrayList.
Eelco On 9/16/05, Nick Heudecker <[EMAIL PROTECTED]> wrote: > That fails anyway because Collections.EMPTY_LIST is an AbstractList. > AbstractList#add(Object) throws an exception. > > > On 9/15/05, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > > > > > True, but a reasonable behavior is: > > > > getList().add(some object) which fails if model object is null. > > > > -Igor > > > > > > > > > > > > > > ________________________________ > > > > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Johan Compagner > > Sent: Thursday, September 15, 2005 4:17 PM > > To: [email protected] > > Subject: Re: [Wicket-user] Possible ListView Bug > > > > > > > > > > why would it be if you ASK for the list through getList() > > suddenly the model be set if at that time the model was empty > > That is just strange/wrong. > > > > The contract of getList is just it will return a empty list if the model > is null > > so you don't have to test for null everytime you use getList. > > > > It is just for youre convinience. > > > > > > On 9/15/05, Nick Heudecker <[EMAIL PROTECTED]> wrote: > > > > I believe it's a bug because it doesn't do what the user reasonably > expects and it's not covered in the javadoc. > > > > > > > > > > > > On 9/15/05, Johan Compagner < [EMAIL PROTECTED]> wrote: > > > > why would that a bug? > > it is just a check that getList() never returns null. > > > > > > > > > > > > > > > > On 9/15/05, Nick Heudecker <[EMAIL PROTECTED] > wrote: > > > > This looks like a bug to me. > > > > public final List getList() > > { > > final List list = (List)getModelObject(); > > if (list == null) > > { > > return Collections.EMPTY_LIST; > > } > > return list; > > } > > > > The problem is if the model list is null, the Collections.EMPTY_LIST is > returned but it's never set as the model object. > > > > > > > > > > > > > > > > > > ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
